Showing posts with label dbms. Show all posts
Showing posts with label dbms. Show all posts

Lab 6 : Exercise on Create, Insert, Select and Join Query with DBMS concepts

A binary relationship with 1:1 cardinality ratio, an employee can have one car and a car is used by one employee only. Do the following action as per your DBMS concepts

1. Create necessary tables with constraint and necessary field
2. Insert values to tables
3. Show values
4. Find the id and the type of car assigned to employee ‘123’
5. Find the name of the employee and the make(type) of the car, if she/he drives car 987.         Where 987 is the id of a particular car.


Database management System is software, which is use for maintaining Database. Database System supports single-user and multiples-user environment. While one hand DBMS permits only one person to access the Database at a given time on the other hand RDBMS allows many users simultaneous access to the Database. A Database System consists of two parts namely, Database Management System and Database Application. Database Management System is the program that Organizes and maintains the information whereas the Database Application is the program that lets us view, retrieve and update information stored in the DBMS.

An entity is any object, place, person, concept or activity about which an enterprise records Data.
 An attribute is the characteristic property of an existing entity. Consider for an example:

Student id
Cse 1101
Cse 1102


Student Table

Key word: Select, Create, Insert

Entity/Field Name
Data Type

DDL for Create Above Table:

SQL>create table student
(student_id number(10),
name varchar2(30),   
program_id varchar2(15),
city varchar2(15),
division varchar2(15),
country varchar2(15)

After created the student table, naturally we may try to insert some values or data. It’s a natural sense to keep data in database for further use. To see the inserted data, the SELECT command is only one way according to the SQL statement writing rule.

Insert Value for Above Table:

SQL> insert into student
    values(200819222,'Adina Bashar','English','Noakhali','Chittgong','Bangladesh');

Using the above command Insert some values as you like. After that or after some moments you may see your data. Use the below statement to see your inserted data or value/records. There are lots of styles of inserting values to the table. Visit HERE to get more ideas of insert command.

View or See Value from Above Table:

SQL> select * from student;
The above statement will return all records with all field from student table.

SQL> select student_id,name from student;
The above SQL command will return only student_id and name of all students.

SQL> select name, city from student where student_id=200819222;
The above SQL command will return only name and city of a student whose id is 200819222.

Click HERE to view more example of SELECT command

In Day-1, our target is to understand the SQL, not to know create, insert or any other SQL command. We will discuss for those with details. The day is only to understand the SQL and the three clauses of SQL statement. They are SELECT, FROM and WHERE and also their implementation.

Some Things You Must Know about Database Management related to SQL. <<CLICK HERE>>

Popular Posts