SQL Flashcards

1
Q

How would you rate yourself in SQL?

A

1-4: Beginner
5-6: Intermediate
6+: Advanced

Answer 1: From the SDET point of view I would consider my SQL skills to be at an 8 out of 10.

Answer 2: I would rate myself 6 out 10 since I am not a database administrator but can perform the necessary queries as an SDET.

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

What is a Database?

A

A database is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a database management system (DBMS).

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

What is RDBMS? How is it different from DBMS?

A

DBMS stands for Database Management System, and RDBMS is the acronym for the Relational Database Management system. In DBMS, the data is stored as a file, whereas in RDBMS, data is stored in the form of tables.

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

What does SQL stand for?

A

SQL ⇒ Structured Query Language.

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

What does Relational mean when we are referring to Relational Database?

A

Relational Databases are structured with tables connected through Primary and foreign key relationships.

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

Are you familiar with any constraints in SQL?

A

Constraint ⇒ Rules for relational databases.

Primary Key ⇒ A unique identifier in a table that helps identify a specific row for a given table.

Uniquely identifies a record in the table.

Foreign Key ⇒ A foreign is a column within a table that is a primary key in another table.

Unique/composite Key ⇒ A column in a table that is not the primary key but only has unique values.

NOT NULL ⇒ There should always be a value defined.

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

What tools are you using to work with your database?

A

Currently in my company the application database is a MySQL based server.

I use MySQL workbench to connect to my application database and run queries.

DB Viewer ⇒ MySQL workbench
DB server ⇒ MySQL

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

What is a Primary Key?

A

Primary Key ⇒ A unique identifier in a table that helps identify a specific row for a given table.

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

What is a Foreign Key?

A

Foreign Key ⇒ A foreign is a column within a table that is a primary key in another table.

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

What is a UNIQUE key?

A

Unique/composite Key ⇒ A column in a table that is not the primary key but only has unique values.

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

What is a Join? What are the different types?

A

What is a Join? ⇒ The process of combining data between 2 or more tables.

INNER
LEFT
RIGHT
FULL
SELF

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

Have you heard of an index before?

A

Indexes are special items added to database tables to allow faster retrieval of data.

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

What is a subquery?

A

A query within a query.
Example:
When you need another query to filter a specific value that becomes an input to your main query.

SELECT *
FROM table where column = (Inner query);

Need to find the employees that make more than the average salary?

Select employee_name, phone, email
From employees
Where avg salary > (SELECT avg salary from employees);

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

What is UNION? What is the difference between UNION and UNION ALL?

A

UNION ⇒ When you combine the output between multiple independent select statements. (removes duplicate)

UNION ⇒ When you combine the output between multiple independent select statements. (removes duplicate)

UNION ALL => (output will be duplicates and non duplicates)

Rules:
1. Same number of columns in each query.
2. Order of the column and data type needs to match.

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