write sql query for the following:1. create database - emp2.create table - employee with 4 columns3.To see table structure
Question
write sql query for the following:1. create database - emp2.create table - employee with 4 columns3.To see table structure
Solution
Sure, here are the SQL queries for your requirements:
- To create a database named 'emp':
CREATE DATABASE emp;
- To create a table named 'employee' with 4 columns (I'll assume the columns are id, name, position, and salary for this example):
USE emp;
CREATE TABLE employee (
id INT PRIMARY KEY,
name VARCHAR(100),
position VARCHAR(100),
salary DECIMAL(10,2)
);
- To see the structure of the 'employee' table:
DESCRIBE employee;
Please replace the column names and types in the 'CREATE TABLE' query with the ones you need for your table.
Similar Questions
Write queries for the following tables:T1 ( Empno, Ename , Salary, Designation)T2 (Empno, Deptno.)(1) Display the Deptno in which Employee Seeta is working.(2) Display Empno, Ename, Deptno.
Create Table Employee with attributes firstName,LastName,SSN,Address,Salary,Birthday,Sex,SupervisorSSN,DepartmentNo
1. Create a table called EMP with the following structure. Name Type EMPNO NUMBER (6) ENAME VARCHAR2 (20) JOB VARCHAR2 (10) DEPTNO NUMBER (3) SAL NUMBER (7,2) Allow NULL for all columns except ename and job. 2. Add constraints to check, while entering the empno value (i.e) empno > 100. 3. Define the field DEPTNO as unique. 4. Create a primary key constraint for the table(EMPNO). 5. Write queries to implement and practice constraints.
Find the following table EmployeeDetails, with the attributes EmployeeID, EmpName, Designation, Salary, DeptNo. You are assigned to a task of providing the solution to the operations department by writing the query which displays the employeeID and the Designation of all the employees whose Salaries are more than the Salary of employees designated as ManagerC
Write queries for the following.Employee ( EID, Name, Age, Salary)Department ( DID, D_Name, EID,Country)(1) Create a view Emp_India which contains the name, age and salary of Indianemployees.(2) Display the name of employee in descending order whose Country starts with ‘I’
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.