Identify types of SQL statement Flashcards

1
Q

What are common relational database management systems that use SQL?

A
  • Microsoft SQL server
  • MySQL
  • PostgreSQL
  • MariaDB
  • Oracle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is SQL?

A

SQL stands for Structured Query Language and is used to communicate with a relational database. It’s the standard language for relational database management systems (RBMS).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What SQL statements can be used to achieve almost everything you need to do with a database?

A
  1. Select
  2. Update
  3. Insert
  4. Delete
  5. Create
  6. Drop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are common dialects of SQL?

A
  • Transact-SQL (T-SQL): Use by by Microsoft SQL server and Azure SQL services.
  • pgSQL: Use by PostgreSQL.
  • PL (procedural language)/SQL: Use by Oracle.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Data Definition Language (DDL) and the common statements?

A

DDL statements are used to create, modify, and remove tables and other objects in a database (tables, stored procedures, views, etc.)
Common DDL statements:
* CREATE - create a new object in database
* ALTER - modify the structure of an object.
* DROP - remove an object from the database.
* RENANME - rename an exisiting object.

Example:
CREATE TABLE Product
(
ID INT PRIMARY KEY,
Name VARCHAR(20) NOT NULL,
Price DECIMAL NULL);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Data Control Language (DCL) and the common statements?

A

DCL statements are used to manage access to objects in a database by granting, denying, or revoking permissions to specific users or groups.
Main DCL statements:
* GRANT - grant permissions to perform specific actions.
* DENY - deny permissions to perform specific actions.
* REVOKE - remove previously granted permission.

Example:
GRANT SELECT, INSERT, UPDATE
ON Product TO user1;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Data Manipulation Language (DML) and the common statements?

A

DML statement are used to manipulate the rows in tables. They enable users to retrieve data, insert new rows, or modify existing rows.
Main statements:
* SELECT - read rows from a table
* INSERT - insert new rows into a table
* UPDATE - modify data in existing rows
* DELETE - delete exisiting rows

Example:
SELECT * FROM Customer WHERE City = “Seattle”:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly