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

Database Management System Lab-Exp1

Lab file

Uploaded by

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

Database Management System Lab-Exp1

Lab file

Uploaded by

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

DATABASE MANAGEMENT SYSTEM LAB

Name: Pranshu Tripathi


Enrollment No. A50105223005
Experiment No.: 1
AIM: Basic SQL Commands

1. Create Database
Syntax:

CREATE DATABASE databasename;

Output:

2. Create Table
Syntax:
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
Output:

3. Select

Syntax:
SELECT column1, column2, ...
FROM table_name;
Output:

4. Insert Into
Syntax:
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);

Output:

5. Where

Syntax:
SELECT column1, column2, ...
FROM table_name
WHERE condition;

Output:

6. Distinct
Syntax:
SELECT DISTINCT column1, column2, ...
FROM table_name;

Output:

7. Order By

Syntax:
SELECT column1, column2, ...
FROM table_name
ORDER BY column1, column2, ... ASC|DESC;

Output:
8. NULL
Syntax:
SELECT column_names
FROM table_name
WHERE column_name IS NULL;
Output:

9. AND
Syntax:

SELECT column1, column2, ...


FROM table_name
WHERE condition1 AND condition2 AND condition3 ...;

Output:
10. OR

Syntax:

SELECT column1, column2, ...


FROM table_name
WHERE condition1 OR condition2 OR condition3 ...;

Output:

11. NOT
Syntax:

SELECT column1, column2, ...


FROM table_name
WHERE NOT condition;

Output:
12. Update
Syntax:

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

Output:

13. Select Top


Syntax:
SELECT column_name(s)
FROM table_name
WHERE condition
LIMIT number;
MySQl does not support the keyword ‘TOP’ instead uses LIMIT to perform the operation.
Output:

You might also like