Sql date interview questions

preview_player
Показать описание
In this video we will discuss the common date related sql interview questions and answers. If you are comfortable with the SQL Date functions, then you should be able to easily answer most of these questions.

Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.

Text version of the video

Slides

SQL Server Interview Questions and Answers

SQL Server Interview Questions and Answers - Text Articles & Slides

Angular, JavaScript, jQuery, Dot Net & SQL Playlists

It is also useful to understand SQL CAST & CONVERT functions. We discussed DATE, CAST & CONVERT functions in Parts 25 to 28 in our SQL Server Tutorial.

After watching this video you should be able to answer any sql date interview questions similar to the following.

Write a SQL query to get

1. All people who are born on a given date (For example, 9th October 2017)

2. All people who are born between 2 given dates (For example, all people born between Nov 1, 2017 and Dec 31, 2017)

3. All people who are born on the same day and month excluding the year (For example, 9th October)

4. All people who are born yesterday, today, tomorrow, last seven days, and next 7 days

5. All people whose birth year is the same (For example, all people born in 2017, 2018 etc.)

Once you are comfortable answering these questions you can extend the concepts you have learned to answer similar questions like the following.

1. Orders placed between 2 given dates or on a given day, month, year etc.

2. Customers gained or lost.

3. Employees joined or left etc.
Рекомендации по теме
Комментарии
Автор

Can someone urge Indian Government to award Bharat Ratna to Venkat Sir.He is a real teacher.I cannot say how many are placed just because of his videos but there are many who are working in MNC's just because of him.

BornDude
Автор

Thank you sir for helping us
Your YouTube channel is the best .

NaseerAhmad-ckvs
Автор

You are too good. Everytime I go for an interview I always lookup for your videos.

vaibhavvaibhav
Автор

This is very very imp video which u needed much long before..Thank u sir ...

saktiprasadswain
Автор

May Allah bless you. Plz keep uploading videos

naazlyhameed
Автор

Great teaching sir. Please add video for difference between ANALYTICAL and AGGREGATE functions in SQL

swethaveluguri
Автор

I learned a lot from your videos.Thank you so much & Could you please also make a lectures for database administrator.

habtomnigatu
Автор

Thank you sir for preparing such a nice video series. Please make such a nice videos on SSIS and SSRS..

jaydeepchavda
Автор

Thank you so much for this SQL tutorial series. You really are awesome

quadirnawaz
Автор

Thank you Venkat for all your videos :)

jennylockwood
Автор

Thank you so much
all vedios are based on real time questions...

KrishnaBallaviRath
Автор

Sir, please also suggest the Oracle counterpart for these solutions to workaround with datetime

darshgupta
Автор

Could you make a playlist with all these 16 parts of Q&A? Thank you very much!

shrk
Автор

could you plz ulpoad emi calaculation in strored procedures with auto-genarated in month or years

seetharamkothapalli
Автор

Very nice video for interviews, the way of explanation is awesome. can you please make a video on CASE function please

adinarayanamamilla
Автор

Man, Who u really are.
because for me you're my database angel.

book_addict.
Автор

Sir please make video tutorial for msbi and powerBI if possible

sambitpati
Автор

hi Venkat, thanks a lot for the most useful videos, can u please solve this query by tomorrow at least try to comment the code its important.
1)list out the employee names who purchased at least 5 items on two separate days?

voletilahari
Автор

Sir can you post an example for fetching consecutive empty seats....from seats table that has Id seat number and availability columns..input is dynamic like 3 seats or 5 seats...but should be consecutive next to each other...ex bookmyshow app

sams
Автор

Here are some frequently encountered SQL interview question, and my top tips to answering them:

1. What is SQL?

SQL, Structured Query Language, is a programming language designed for working with databases. Some people, however, argue that it is not exactly a programming language since it has not been created with the notion of using features of procedural languages, such as conditional statements or “for” loops. These people insist on calling SQL a coding language because it is only about executing commands for querying, creating, inserting, updating, and deleting data in a database. Nonetheless, the most important thing is to know what the domain of SQL is.

2. What is a Database? What is a DBMS?
A database is data stored on a computer and ordered in a way that makes it easy to access and manipulate. a database management system – DBMS is the software tool that allows users to interact with the data stored in the database.

You could conclude by explaining there are two types of database management systems – relational and non-relational. SQL is a language, designed only for working with relational DBMSs.

Such questions are usually asked in the beginning of the interview so that you can start preparing for the difficult ones.

3. What is the difference between DDL, DML, DCL, and TCL?

First of all, let’s explain what there acronyms stand for:

“L” stands for “Language” in all of them. And this must help you remember that these are the four categories in which the SQL commands have been separated into.

DDL stands for Data Definition Language and includes the commands that allow you to CREATE, DROP, ALTER, and TRUNCATE data structures. DML involves commands for manipulating information. It actually means “Data Manipulation Language”, and gives the possibility to SELECT, INSERT, UPDATE, and DELETE data. it is this part of the language you will most use at work, if you are using SQL in the field of data science or business intelligence.
DCL, Data Control Language, consists of commands that are usually used by database administrators. This one allows programmers to GRANT and REVOKE rights defining how much control you can have over the information in the database.

Similarly, TCL, which is the Transaction Control Language, also includes the commands applied by database administrators. These command ensures that the danger of suffering from data loss is minimal.

4. What is the point of using a foreign key constraint?

The foreign key constraint comprises a set of rules, or limits, that will ensure that the values in the child and parent tables match. Theoretically, the foreign key constraint will maintain the referential integrity within the database.

5. Define and provide an example of using an inner join.

Obviously, you must be aware that joins are one of the most frequently used tools in SQL, regardless of your job role. Particularly if you are working in the sphere of business intelligence, your work will be centred around understanding SQL joins in depth.

So, an SQL join is a tool that allows you to construct a relationship between objects in your database. Consequently, a join shows a result set containing fields derived from two or more tables.

For instance, assume that in one table you have data about the customer ID and fields related to the sales a customer has made, and in the other, you have data about the customer ID and their private information, such as first and last name and email address. Therefore, an inner join allows you to obtain an output containing information from both tables only for the customer IDs found in the two tables that match. Provided that you set the customer ID field to be a matching column, of course.


6. What is the difference between MySQL and PostgreSQL? How about between PL/SQL and SQL?

The interviewers ask these questions as they want to find out how much you are acquainted with the fact that SQL has a few versions, each carrying specific features.

You could say that MySQL and PostgreSQL are just two versions of the Structured Query Language. Since you’ve just been asked about joins, you could mention that PostgreSQL supports outer joins, while MySQL doesn’t – you’ll need to use UNION or UNION ALL to emulate an outer join in MySQL. This way you could even impress the interviewers with extra knowledge in this subject.

PL/SQL is not a version of SQL, however, and that’s the tricky part of the question. PL/SQL is a complete procedural programming language and its scope of application is different. It is not strictly related to relational databases.

7. What is an SQL View?

Your potential future employers may want to give a toned-down SQL interview question. That’s why they might ask a general question.

A view is a virtual table whose contents are obtained from an existing table or tables, called base tables. The retrieval happens through an SQL statement, incorporated into the view. In other words, you can think of a view object as a view into the base table. The view itself does not contain any real data; the data is electronically stored in the base table. The view simply shows the data contained in the base table.

Good luck!

Best,
365 Data Science
Online educational career website

DataScience