1.How to set MySQL Root password?(Let user name is root). Ans-Use mysqladmin command to set the password for root and
set the password Myroot@1234 with below command- mysqladmin -u root password MYroot@1234 2. How to Change MySQL Root password?
(let you want to change from password MYroot@1234 to MadeINindia@2017). Ans-Syntax: mysqladmin -u root -p<old password> password 'New Password' Example- mysqladmin -u root -pMYroot@1234 password 'MadeINindia@2017' 3. How to check MySQL Server is running? Ans-mysqladmin -u root -p ping 4.How to Check which MySQL version I am running? Ans-mysqladmin -u root -p version 5.How to create a Database in MySQL server?(assume the database name is Mydatabase). Ans-Syntax: mysqladmin -u root -p create <databasename> Example- mysqladmin -u root -p create Mydatabase Enter password: 6.How to create the table named as employee with ID,Name,email,address,phone number,salary.
Note-ID is the primary key of the employee table and assume the data type as well. Ans-Create table employee( ID varchar2(20), Name varchar2(20), email varchar2(20), address varchar2(20), phone_number number, salary number, primary key (ID)); 7.View the detail for the table employee. Ans-desc employee 8.Write a query to insert the 5 record into the table names as employee. Ans- insert into employee(ID,Name,email,address,phone_number,salary) values("1","sharat","sarat@gmail.com","Hyderbad",123456890,5000); insert into employee(ID,Name,email,address,phone_number,salary) values("2","Ajay","ajay@gmail.com","Hyderbad",16756890,51000); insert into employee(ID,Name,email,address,phone_number,salary) values("3","Amit","amit@gmail.com","Delhi",16756890,51000); insert into employee(ID,Name,email,address,phone_number,salary) values("4","Aman","Aman@gmail.com","Lucknow",26756890,51000); insert into employee(ID,Name,email,address,phone_number,salary) values("5","Hari","Hari@gmail.com","Lucknow",36756890,15000); 9. How to verify the data entered into table named employee? Ans-SELECT * from employee. Output- Number of Records: 5 ID Name email address phone_number salary 1 sharat sarat@gmail.com Hyderbad 123456890 5000 2 Ajay ajay@gmail.com Hyderbad 16756890 51000 3 Amit amit@gmail.com Delhi 16756890 51000 4 Aman Aman@gmail.com Lucknow 26756890 51000 5 Hari Hari@gmail.com Lucknow 36756890 15000 10.What are the Data defintion language (DDL) commands used in SQL. Ans-CREATE, ALTER,DROP,RENAME,TRUNCATE 11.What are the Data Manipulation Language (DML) commands used in SQL. Ans-DELETE, UPDATE,INSERT 12.What are the Data Control Language (DCL) commands used in SQL. Ans-GRANT, REVOKE 13.What are the Transaction Control Language (TCL) commands used in SQL. Ans-SAVE POINT, ROLLBACK, COMMIT
14.Which command is used to retrived the data from the database. Ans-SELECT
15.What is SQL? SQL( Structured Query Language) is an ANSI (American National Standards Institute) standard.it is used to access, modification and update the data into the database. 16-How SQL is used in the database. SQL can execute queries that retrieve the data,insert,delete and modify the data into database.SQL can create the new databases,new tables, new view, new function, new procedure etc. 17-Can we use SQL to build the Website? What knowledge we need to build the web site? Ans Yes. You need the following knowledge to build the website 1-A RDBMS data base such as MS Access, MySQL,SQL Server etc. 2-A Server-side Scripting language like ASP,PHP 3-A SQL to retrieve the data that you want 4- HTML/CSS 18.Does SQL support programming features? No, SQL doesn't have programming feature such as loop or Conditional statement etc. 19.What do mean by key words , clauses and statements in oracle? Ans-Key words are the reserve word such as SELECT, DELETE, INSERT etcClause-it is part of SQL Statement. for example SELECT clause as SELECT emp_name ,salary . ...as a clauseStatements- it is the combination of two or more clauses. for example- select emp_name, salary from EMP. 20.What are the different clauses for the SQL statement. Ans-SELECT ...FROM ... WHERE... GROUP BY ... HAVING.... ORDER BY... 21.What are the mandatory clause in oracle database Ans.SELECT and FROM are mandatory clause
No comments:
Post a Comment