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

Assignment

The document provides SQL syntax and queries for creating databases and tables, specifically for an 'employee' and 'department' table. It includes instructions for inserting records and fetching details from these tables. Additionally, it outlines the structure of the SQL commands and examples of how to use them effectively.

Uploaded by

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

Assignment

The document provides SQL syntax and queries for creating databases and tables, specifically for an 'employee' and 'department' table. It includes instructions for inserting records and fetching details from these tables. Additionally, it outlines the structure of the SQL commands and examples of how to use them effectively.

Uploaded by

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

SQl

Week-1 Assignment

By
Varun Murugulla
Creating Database:
Syntax:
create database dbname;
Query:
create database cgsoffice;
use cgsoffice;
Note: “USE” query is to use
Specific database.

 Write a query to fetch all the details employee table.


 Write a query to fetch all the details from the department table
 Write a query to fetch name from emp table
 Create a table name employee with columns S.NO, Name, age, salary, and
insert 3 records.
Creating a Table:
Syntax:
create table tablename
(
Column1 datatype,
Column1 datatype,
Column1 datatype,
.
.
Columnn datatype
);

Query: Output:
Inserting Data / Record:

Syntax:
insert into tablename(column1,column2,…)values
(value1,value2,…),
(value1,value2,…),
(value1,value2,…);

Query:

Note: “select*
from employee;
It is used to show the column what we insert.

Output:

 Create a table name department with columns DNO, Dname, Designation,


with 5 records.
Creating a Table:
Syntax:
create table tablename
(
Column1 datatype,
Column1 datatype,
Column1 datatype,
.
.
Columnn datatype
);
Query: Output:
Inserting Data / Record:
Syntax:
insert into tablename(column1,column2,…)values
(value1,value2,…),
(value1,value2,…),
(value1,value2,…);

Query:

Output:

You might also like