0% found this document useful (0 votes)
23 views6 pages

ADBMS

The document discusses various SQL commands and concepts. It covers commands to create and manage databases and tables, as well as queries using SELECT, JOINs, operators like AND and OR, UNION, INTERSECT and aggregate functions. It also covers constraints like NOT NULL, UNIQUE, PRIMARY KEY and FOREIGN KEY that enforce data integrity.

Uploaded by

pooja verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views6 pages

ADBMS

The document discusses various SQL commands and concepts. It covers commands to create and manage databases and tables, as well as queries using SELECT, JOINs, operators like AND and OR, UNION, INTERSECT and aggregate functions. It also covers constraints like NOT NULL, UNIQUE, PRIMARY KEY and FOREIGN KEY that enforce data integrity.

Uploaded by

pooja verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

ADBMS

ASSIGNMENT 1
 COMMANDS
 Create database To create a database(assig)
 Use database For use the database
 Create table(table name)
 Insert into table values

 Select Command (select* from table name)

 Describe command(describe table name)

 ALTER TABLE ADD COLUMN

 ALTER TABLE DROP COLUMN

 ALTER TABLE - ALTER/MODIFY DATATYPE

 SQL UPDATE Statement


Different Types of SQL JOINs
Here are the different types of the JOINs in SQL:

 (INNER) JOIN: Returns records that have matching values in both tables
 LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table
 RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left table
 FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table

INNER JOIN

LEFT JOIN

RIGHT JOIN

FULL JOIN

AND OPERATOR The AND operator displays a record if all the conditions are TRUE.
The OR operator displays a record if any of the conditions are TRUE.

OR OPERATOR The OR operator displays a record if any of the conditions are TRUE.
BETWEEN OPERATOR The BETWEEN operator selects values within a given range.
The values can be numbers, text, or dates.

UNION OPEROTER
 Every SELECT statement within UNION must have the same number of columns
 The columns must also have similar data types
 The columns in every SELECT statement must also be in the same order

INTERSECT An INTERSECT query returns the intersection of 2 or more datasets. If a record exists in
both data sets, it will be included in the INTERSECT results.

SQL AGGRIGATE FUNCTION


SQL COUNT(), AVG() and SUM() Functions

SQL COUNT()

SQL SUM()

SQL AVG()
SQL MIN ()

SQL MAX ()

SQL Constraint

SQL NOT NULL Constraint

SQL UNIQUE Constraint

SQL PRIMARY KEY Constraint

SQL FOREIGN KEY Constraint

You might also like