SQL Flashcards

1
Q

What is SQL

A

Standard for managing data kept in relational database management systems

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

What is MySQL

A

Open source relational database management system

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

What are Joins?

A

Right, left, inner, and full joins combine rows from two or more tables

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

Index

A

An index is a pointer to data contained within a table which allows for faster retrieval of records

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

Constraints

A

Specify a rule for the data within a table limiting the type of data that can go within

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

Type of Constraints

A

Primary key - identifies each record in a table
Not Null - used to prevent a Null value
Foreign Key - provides a unique identification of a row or record within another table
Default - automatically assigns a default value if there has not been a value already specified for a field
Check - used to verify that all values meet a specific criteria or condition in a field
Unique - ensures unique values are always inserted into a column
Index - used to create data and to obtain it from a database

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

What are a Table and Field

A

Table: a collection of data that is organized into rows and columns
Columns are called fields and rows are records

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

Data Control Language (DCL)

A

permits you to control access to the database

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

Data Definition Language (DDL)

A

allows you to specify data structure in the database including deleting tables, creating them, or altering them

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

Data Manipulation Language (DML)

A

allows you to manipulate data, update, insert, delete, or retrieve

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

How to format SQL dates

A

Format function (SELECT FORMAT getDate(), ‘dd/MM/yyyy’)

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

Primary Key

A

A primary key is used to ensure data in the specific column is unique and uniquely identifies a record in the relational database.

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

Foreign Key

A

A foreign key is a column or group of columns in a relational database table that provides a link between data in two tables.
It refers to the field in a table which is the primary key of another table.

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

What is Database denormalization

A

Is a method used to improve the performance of a database, allowing the retrieval of data in the quickest time possible.
Adds redundant database data into a table which in turn enables the performance of databases to improve, as the same data can be put in several places.

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

Subquery

A

Subquery is a query nested inside a larger query

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