New video for learners is now available guys, if you like it, feel free to like, subscribe and share๐๐
https://www.youtube.com/watch?v=wS2ULNE3wx8
https://www.youtube.com/watch?v=wS2ULNE3wx8
YouTube
SQL Task Tutorial for Beginners /#2 - Two ways how to select the last record only
Join our Telegram channel to have more quizzes and tasks with answers: t.me/SQL_Challenges
You may use the following platform to practice SQL queries:
www.w3schools.com/sql/
#shorts #sql #sqlqueries #sqlforbeginners #sqltutorial #sqltutorialforbeginnersโฆ
You may use the following platform to practice SQL queries:
www.w3schools.com/sql/
#shorts #sql #sqlqueries #sqlforbeginners #sqltutorial #sqltutorialforbeginnersโฆ
๐1
Which query will return the current version of the MySQL database?
Anonymous Quiz
35%
SELECT VERSION();
10%
DISPLAY VERSION;
12%
SELECT GETVERSION();
10%
SELECT VERSION FROM <Table_Name>;
15%
SELECT GETCURRENTVERSION();
16%
SHOW VERSION();
1%
SELECT (VERSION);
Which query will return the number of ALL records from the Customers table?
Anonymous Quiz
13%
SELECT COUNT("Hello") FROM Customers;
7%
SELECT NUM() FROM Customers;
16%
SELECT COUNT FROM Customers;
41%
SELECT COUNT(Customer) FROM Customers;
23%
None of the queries
Is it possible to sort records by the column alias?
Anonymous Quiz
58%
Yes, it is possible
16%
No, it is not possible
26%
It is possible but only when alias is used in tandem with aggregation functions
๐1
What is the important condition when we use the INSERT INTO SELECT operator?
Anonymous Quiz
48%
The data types in both tables must match.
27%
The number of records in both tables should be the same.
14%
These tables should have relations.
11%
None of the above.
๐3
SQL Task
Table name: Customers;
Field name: City;
Select all the cities which names start with S, but not end with n.
You can execute query here
Hint: If you gonna use w3schools default database, the correct request should return 11 records.
Feel free to write your answer as a comment to this task.
#task
Table name: Customers;
Field name: City;
Select all the cities which names start with S, but not end with n.
You can execute query here
Hint: If you gonna use w3schools default database, the correct request should return 11 records.
Feel free to write your answer as a comment to this task.
#task
โค1๐1
Is it correct to say that NULL value is the same as zero or space?
Anonymous Quiz
16%
NULL value is a synonym to 0, but space is a different thing.
6%
Yes, all the mentioned values can be used interchangeably.
10%
It is ok, to consider NULL as a synonym to space, but 0 is a digit.
68%
No, NULL value is not equal to 0 or space.
โค1
The Database Dump is most often used to:
Anonymous Quiz
50%
Make a database backup.
25%
Encrypt a database in order to hide the information.
10%
Update a database.
15%
Delete a database.
How information should be represented in the relational database?
Anonymous Quiz
36%
All information must be explicitly represented in a single way: by values in tables.
9%
Doesn't matter all the databases have the same logic of data representation.
6%
Relational database is just a set of unconnected data.
49%
Relational database implies that all information is represented in one two-dimensional table.
๐1
You may see the Products table on the picture.
Write a query to find the second highest price value in the table.
You can execute query here
Please feel free to provide your solution in the comments to this post.
SOLUTION
SELECT MAX(Price) FROM Products WHERE Price < (SELECT MAX(Price) FROM Products);
#task
Write a query to find the second highest price value in the table.
You can execute query here
Please feel free to provide your solution in the comments to this post.
SOLUTION
๐1
Which type of relation is reflected on the picture?
Anonymous Quiz
26%
One-to-one
41%
One-to-many
25%
Many-to-many
9%
All-to-all
A view is nothing but a ________ table or a stored query
Anonymous Quiz
15%
Dynamic
3%
Real
10%
Custom
65%
Virtual
4%
Basic
3%
Common
Orders table structure is reflected on the picture.
1) Write a query to select the average number of orders made by the customers.
2) Round the result to one decimal place.
3) The resultant field should be named as follows:
AVG OrdersNumber.
Example: Let's say if someone from clients made 3 orders, another one made 5 orders, and someone else made 2 orders. So 10 / 3, and since the result should be rounded according the the task, the output will be: 3.3.
You may practice and execute your query here
Please feel free to provide your solution in the comments to this post.
NOTE: Please use the Spoiler feature, when posting your solution, in order to give the chance to think to others.
#task
1) Write a query to select the average number of orders made by the customers.
2) Round the result to one decimal place.
3) The resultant field should be named as follows:
AVG OrdersNumber.
Example: Let's say if someone from clients made 3 orders, another one made 5 orders, and someone else made 2 orders. So 10 / 3, and since the result should be rounded according the the task, the output will be: 3.3.
You may practice and execute your query here
Please feel free to provide your solution in the comments to this post.
NOTE: Please use the Spoiler feature, when posting your solution, in order to give the chance to think to others.
#task
After solving the task from the previous post, you may check your result, by selecting the correct option:
Anonymous Quiz
29%
3.2
48%
3.0
10%
2.8
10%
2.6
3%
1.9