CRUD Flashcards

1
Q

How to do an insert to the table “employees” the columns “id”, “name” and “title”?

A

INSERT INTO employees(id, name, title)
VALUES (1, ‘Allan’, ‘Engineer’);

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

Does SQL support UUID?

A

NO

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

Which function to user to retrieve the number of records of a column?

A

COUNT

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

How to delete employee with id equal to 251 from the “employees” table?

A

DELETE from employees WHERE id = 251;

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

2 ways to protect agains losing data on DELETE?

A
  1. Backup
  2. Soft delete
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a soft delete?

A

A “soft delete” is when you don’t actually delete data from your database, but instead just “mark” the data as deleted

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

Write an SQL query to update the “job_title” and “salary” for an employee with the ID of 251 in the ‘employees’ table, setting the job title to ‘Backend Engineer’ and the salary to 150000?

A

UPDATE employees
SET job_title = ‘Backend Engineer’, salary = 150000
WHERE id = 251;

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

What ORM stands for?

A

Object Relational Mapping

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

What is an ORM?

A

A tool that allows you to perform CRUD operations on a database using a traditional programming language.

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