Database/SQL Flashcards

1
Q

What is a database?

A

a database is a collection of information that is organized so that it can be easily accessed, managed and updated.

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

What is relational database ?

A

A relational database uses a structure that allows us to identify and access data in relation to another piece of data in the database. usually organized into tables.

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

What are rows called in databases ?

A

Records

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

What is a relational database management system ?

A

a relational database management system RDBMS, is a program that allows you to create, update, and administer a relational database. Most systems use SQL to access the database.

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

What is SQL ?

A

SQL, structured query language, is a programming language used to communicate with data stored in a relational database management system.

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

Name some uses of SQL

A
  1. Allows users to access data in the RDBMS.
  2. Allows users to describe data
  3. Allows users to define and manipulate data in a database
  4. Allows users to set permissions on tables, procedures, and views
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a primary key ?

A

A primary key is a field in a table which uniquely identifies each row/record in a database table.

A table can only have one primary key, which may consist of multiple fields. When multiple fields are used a a primary key, they are called a composite key.

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

What is a foreign key ?

A

A foreign key is used to link two tables together. This is sometimes called a referencing key.

It’s a column or combination of columns whose values match a primary key in a different table.

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

Define SQL statements

A

DDL - Data Definition Language : CREATE, ALTER, DROP

DML - Data Manipulation Language : SELECT, INSERT, UPDATE, DELETE

DCL - Data Control language : GRANT, REVOKE

TCL - Transaction Control Language : SAVEPOINT, ROLLBACK, COMMIT

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

What is the SELECT Query ?

A

A SQL SELECT statement is used to fetch the data from a database table which returns this data in the form of a result table. These result tables are called result-sets.

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

What is SQL WHERE ?

A

The SQL WHERE clause is used to specify a condition while fetching the data from a single table or by joining with multiple tables. It should be used to filter the records and to fetch only the necessary records.

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

What is the INSERT Query ?

A

The INSERT INTO statement is used to add new rows of data to a table in the database.

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

What is SQL Joins ?

A

A Joins clause is used to combine records from 2 or more tables in a database.

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

What are the different types of Joins ?

A

INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN

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