Skip to main content

Posts

AND condition in sql, OR condition in sql, insert,update,delete table using AND , OR condition

AND condition / OR condition. Oracle / sqlserver we use AND / OR  condition in below statement SELECT, INSERT, UPDATE, or DELETE statement. while any operation on the table both condition check the perform the actions. Syntax select * from <table_name> WHERE <condition 1> AND <condition 2> OR condition; For example of AND / OR condition -  SELECT * FROM customer_master WHERE (Name = 'John' AND dept_id = '10') OR (customer_id < 10); we can user multiple or conditions as below , in sql we check the multiple conditions using "AND" "OR" SELECT Customer_id FROM customer_master WHERE (customer_id >= 10) OR (STATE = 'BIHAR' AND state = 'DELHI') OR (JOIN_DATE >= '10-JUN-2010' AND customer_name like 'John%'); when we insert some data using single or multiple table and condition and OR condition is very important. Example- INSERT INTO customer_master (customer_id, customer_name) SELECT cust_id, cust_na
Recent posts

Create table in Sql/plsql in this topic we covered create table , primary key,constraints,releations in table, datatype,not null constraint and basic course and advance course of create table topic.syntax, parameters, arguments, example

Create Table SQL CREATE TABLE statement with syntax, examples, and practice exercises. The SQL CREATE TABLE statement allows you to create and define a table. In this topic cover below sql basic knowledge. Create Table Create table with Primary key constraints Create table with Foreign key constraints Table Relation Add constraints in table Primary key Null and Not null Create table using select  create table with multiple table joins. Statement of CREATE TABLE - Oracle / PLSQL: CREATE TABLE   create table :  Syntax CREATE TABLE table_name (    column1 datatype [ NULL | NOT NULL ],   column2 datatype [ NULL | NOT NULL ],   column_n datatype [ NULL | NOT NULL ] ); while the create table datatype is most important, we can also add null and not null in any column. null define you can allow a null values not null define you can not allow null value in specified column. Example Oracle CREATE TABLE example. CREATE TABLE customers ( customer_id number(10) NOT NULL,   customer_name varchar2(50

Alter table add column,add column to table,alter command in sql,alter table modify column,sql change column name,alter table delete column

How to Alter Table Add column ,Drop column ,Rename table Rename Column. Releated Topic covered under the below index. alter table add column, sql add column, add column to table sql,alter sql,alter command in sql modify a column ,alter table modify column,sql change column name,alter column datatype in sql drop a column,alter table delete column,delete a column in sql rename a column  rename a table  syntax - ALTER TABLE syntax is  ALTER TABLE TABLE_NAME ADD <column name> <Datatype / Defination>; Examples -  ALTER TABLE Employee ADD Emp_number varchar2(45); Alter table with default value ALTER TABLE Employee ADD Active_In_Company Char(1) DEFAULT 'Y'; In this case any employee insert into employee_master as active employee set as "Y" Another example of alter table in multiple column add Add multiple columns in table Syntax -  ALTER TABLE TABLE_NAME ADD (                            <column name> <Datatype / Defination> ,