First we will create a target table. The target table will have an additional column INSERT_DATE to know when a product is loaded into the target table. The target table structure is
The next step is to pick 5 products randomly and then load into target table. While selecting check whether the products are there in the
The last step is to delete the products from the table which are loaded 30 days back.
First we will create a lookup table where we mention the priorities for the content types. The lookup table “Create Statement” and data is shown below.
Here if LOAD_FLAG is 1, then it indicates which content type needs to be loaded into the target table. Only one content type will have LOAD_FLAG as 1. The other content types will have LOAD_FLAG as 0. The target table structure is same as the source table structure.
The third step is to choose the appropriate content type from the lookup table to load the source data into the target table.
If you like this post, then please share it on Google by clicking on the +1 button.
Top 25 SQL Interview Questions and Answers(The BEST SQL Interview Questions)
Basic SQL Interview Questions
All set to kickstart your career in SQL? Look no further and start your professional career with these SQL interview questions for freshers. We will start with the basics and slowly move towards slightly advanced questions to set the pace. If you are an experienced professional, this section will help you brush up on your SQL skills.
What is SQL?
The acronym SQL stands for Structured Query Language. It is the typical language used for relational database maintenance and a wide range of data processing tasks. The first SQL database was created in 1970. It is a database language used for operations such as database creation, deletion, retrieval, and row modification. It is occasionally pronounced “sequel.” It can also be used to manage structured data, which is made up of variables called entities and relationships between those entities.
The next step is to pick 5 products randomly and then load into target table. While selecting check whether the products are there in the
First we will create a target table. The target table will have an additional column INSERT_DATE to know when a product is loaded into the target table. The target table structure is
First we will create a lookup table where we mention the priorities for the content types. The lookup table “Create Statement” and data is shown below.
Here if LOAD_FLAG is 1, then it indicates which content type needs to be loaded into the target table. Only one content type will have LOAD_FLAG as 1. The other content types will have LOAD_FLAG as 0. The target table structure is same as the source table structure.
The third step is to choose the appropriate content type from the lookup table to load the source data into the target table.
What is Database?
A database is a system that helps in collecting, storing and retrieving data. Databases can be complex, and such databases are developed using design and modelling approaches.