0% found this document useful (0 votes)
37 views

Structured Query Language

Structured Query Language (SQL) is used to create and manage databases. The document discusses SQL commands for creating databases and tables, describing table structures, copying data between tables, inserting data into tables from other tables or hardcoded values, and performing select queries to retrieve data from tables.

Uploaded by

Anuj Bhawsar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Structured Query Language

Structured Query Language (SQL) is used to create and manage databases. The document discusses SQL commands for creating databases and tables, describing table structures, copying data between tables, inserting data into tables from other tables or hardcoded values, and performing select queries to retrieve data from tables.

Uploaded by

Anuj Bhawsar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Structured Query Language (SQL)

A field is a column in the table.

Record is a row in the table.

Create data base:

CREATE DATABASE Sample;


USE Sample;
DROP DATABASE Sample;

Creating Table

create table employee


(
id int primary key,
Name varchar(30),
DOB datetime,
email varchar (40)
);

Describe

DESC employee;

Create table from other table

CREATE TABLE emp_info AS SELECT


ID, NAME
FROM employee;
Drop Table

DROP TABLE emp_info ;

Inserting data into table

INSERT INTO employee (id, name, dob, email)


VALUES (1901, 'anuj', '1986-04-19 10:20:00', '[email protected]');

Inserting data into table from another table

INSERT INTO emp_info


SELECT ID, name, dob, email
FROM employee;
SELECT QUERY

SELECT name, email


FROM emp_info;

(*=Stands for all)

SELECT * FROM emp_info;

You might also like