Computer Science, asked by nidhi261057, 1 month ago

3) Given the list of fields
Empid, Empname, Empdepartment, SalaryId, SalaryAmount, Bonus in the tables employee and salary respectively. Define primary key, foreign key and segregate for above fields into employee and salary table. [02]
Solve below queries [04] 1) Write a query for create table employee
2) Write a query for Display all the records from employee table.
3) Write a query for insert any 1 record in salary table.
4) Write a query for update employee record from Atharva to Hinal.

Answers

Answered by allindia1630
0

Step 1: Create a school database Create database school;

Step 2: connect to database \c databasename; \c school;

Step 3: In this database create two tables Employee and Salary with the following fields. Define primary key, foreign key and segregate for above fields into employee and salary table. Empld, EmpName, EmpDepartment, Salaryld, SalaryAmount, Bonus. Create table salary(salaryld Integer PRIMARY KEY,Salaryamount integer,Bonus integer); Create table employeefEmpId integer PRIMARY KEY,EmpName text,EmpDept text,Salaryld integer,FOREIGN KEY(salary ID)”REFERENCES Salaryfsalary id));

Step 4: See both tables select*from salary; select*from employee;

Similar questions