Home
Search results “Oracle drop constraint if exists”
Oracle SQL Tutorial 13 - How to Add Column Constraints (Attributes)
 
05:55
So far, we have this table declaration: CREATE TABLE users( user_id NUMBER, username VARCHAR(50 CHAR) first_name VARCHAR2(50 CHAR), last_name VARCHAR2(50 CHAR) ) We can run this command see that it works. As we are learning though, we are going to want to be able to recreate our table with different settings and such, but if you try to run this command, it will complain that the table already exists. So we first need to delete this table before we start editing settings. When we get more experienced, we will learn about ways to edit the structure of a table that already exists. To fix this, we can get rid of the table using the DROP TABLE command: DROP TABLE users You can run this every time if you need to practice by adding a semicolon after it. This is how you can tell Oracle that you are putting in another command after it. This is known as a delimiter. When you run the script, it is going to run both commands. Now we can go through and reconsider our table structure. This is fine for starting out because we don't have any important data in our database, but once your database is in production you are not going to want to just drop tables. In the last video we discussed different constraints that you can apply to columns in a database table, but how do you actually apply these when you are creating a table? The first way you define constraints is to put them right after the column in your CREATE TABLE statement. CREATE TABLE users( username VARCHAR2(50 CHAR) NOT NULL ) When we define constraints this way, we usually say we are adding column attributes. If you have two constraints you want to add, you just put one after the other with spaces in between. There is no particular order that is required. CREATE TABLE users( username VARCHAR2(50 CHAR) NOT NULL UNIQUE ) In this situation we have already given the column the NOT NULL and UNIQUE attributes, so we should consider making this a primary key: CREATE TABLE users( username VARCHAR2(50 CHAR) PRIMARY KEY ) As you can see, adding column attributes is super easy. We can add a default like this: CREATE TABLE users( username VARCHAR2(50 CHAR) PRIMARY KEY, account_balance NUMBER DEFAULT 0 ) Note that now we need the comma after the first row. There are a few constraints we did not talk go through an example, specifically foreign keys and check constraints. We will be adding these constraints to our database in future videos. In the mean time, I have a thought for you… Many people prefer to name their column constraints. That way, we can refer to certain constraints by name. For example, we might have a primary key constraint that could be named users_pk. The way we are creating these constraints does not allow for this feature, so in the next video we are going to be discussing different ways to create constraints. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me on Patreon! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 24890 Caleb Curry
ON DELETE CLAUSE OF FOREIGN KEY CONSTRAINT IN ORACLE SQL WITH EXAMPLE (CASCADE/SET NULL/NO ACTION)
 
15:31
This is a free video tutorial explaining about the nonmandatory on delete clause in the foreign key constraint in Oracle SQL database, the video explains about how the on delete set null and on delete cascade works, how it can be implemented with easy to understand examples. We have also shown practical demonstration on creating the foreign key constraint, and then deleting the data from the parent table and observing the changes that take place in the child table.
Views: 1604 Kishan Mashru
Could not drop object because it is referenced by a FOREIGN KEY constraint   SQL Server
 
02:55
SQL Server / T-SQL Tutorial Scenario: You are working as SQL Server DBA or Developer, You need to drop a table from a database. When you execute drop table SchemaName.TableName statement, you get below error. Msg 3726, Level 16, State 1, Line 12 Could not drop object 'SchemaName.TableName' because it is referenced by a FOREIGN KEY constraint. Now we know that the table is referenced by Foreign Key Constraint. The problem is how to find which table has that Foreign Key Constraint that is referencing to this table.
Views: 599 Shukisoft
Violation of PRIMARY KEY Constraint and Batches
 
02:53
Evaluate how your application logic looks at records that might already exist.
Views: 2245 SQLInSix Minutes
SQL tutorials 18: SQL Foreign Key Constraint By Manish Sharma
 
10:23
SQL Tutorial 18: SQL foreign key constraint. Topic covered in this tutorial 1. Defining SQL foreign key using create table at column level 2. Defining SQL foreign key using create table at table level 1. Defining SQL foreign key using Alter Table statement Links Website article: http://www.rebellionrider.com/sql-foreign-key.htm Primary key tutorial: http://www.rebellionrider.com/sql-foreign-key.htm Create Table Tutorial: http://www.rebellionrider.com/sql-create-table.html Tool used in this tutorial is SQL Developer. This tutorial series is part of SQL expert exam certification training. if you are preparing for SQL certification you can use my tutorials. This SQL Tutorial is a part of free training. Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=j7eYO7 Contacts E-Mail [email protected] Twitter https://twitter.com/rebellionrider Instagram http://instagram.com/rebellionrider Facebook. https://www.facebook.com/imthebhardwaj Linkedin. http://in.linkedin.com/in/mannbhardwaj/ Thanks for linking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com Foreign key is an Input/output data constraint which is also known as referential integrity constraint. Foreign key represent a link or say a relationship between columns of tables. Similar to primary key constraint Foreign Key constraint is also of two types. Simple Foreign key constraint and Composite Foreign key constraint. Constraint which involves only one column in foreign key in child table and one column in reference key in parent table is called Simple Foreign Key. While the constraint which involves more than one column in foreign key in child table and more than one column in reference key in the parent table is called Composite Foreign Key.
Views: 105942 Manish Sharma
Oracle Using In , Between and Not تعليم أوراكل
 
10:27
by Mohamed El Desouki - محمد الدسوقى [email protected] Tel :00966 553450836 جامعة سلمان بن عبد العزيز - السعودية - الخرج How to use In , Between and Not. Text Book: Fundamentals of Database Systems, 5th Edition, by Elmasri/Navathe, published by Addison-W oracle create table statement oracle drop table statement oracle constraints database constraints primary key constraint foreign key constraint check constraint null not null constraint unique constraint insert into statement update statement delete statement select statement basic query where clause select where Like '%' Like '_' select where Like select where Between Between , Not Between select where In , Not In
Oracle - SQL - Drop Table
 
01:09
Oracle - SQL - Drop Table Watch more Videos at https://www.tutorialspoint.com/videotutorials/index.htm Lecture By: Mr. Anadi Sharma, Tutorials Point India Private Limited.
Oracle SQL Tutorial 15 - How to Add Primary Key Constraints
 
02:54
The goal of this video is to take the CREATE TABLE statement we have and walk through the different ways to create primary keys. This and foreign keys are the most common constraints, so we need to make sure that you have this one down. Once we have a more complex database design with multiple tables, we will learn the proper way to create foreign keys. For now, I am going to keep all of our constraints at the column level, unnamed. The only exception is the primary key, because that is what we are focusing on in this video. The first way to create the primary key is at the column level, unnamed. The primary key is very important because it what we use to distinguish rows from one another. Every table you create is going to need a primary key, and I suggest putting a lot of effort into making sure your keys are set up correctly and organized. --Delete the table if needed: DROP TABLE users; CREATE TABLE users( user_id NUMBER PRIMARY KEY, username VARCHAR2(50 CHAR) NOT NULL UNIQUE ) The next way is at the column level, but named: --Delete the table: DROP TABLE users; CREATE TABLE users( user_id NUMBER CONSTRAINT users_pk PRIMARY KEY, username VARCHAR2(50 CHAR)NOT NULL UNIQUE ) The general naming convention here is the table name followed by an underscore, followed by pk for primary key. Finally, the third way, which is at the table level, is the way we are going to create our primary key: --Delete the table: DROP TABLE users; CREATE TABLE users( user_id NUMBER, username VARCHAR2(50 CHAR) NOT NULL UNIQUE, CONSTRAINT users_pk PRIMARY KEY (user_id) ) Now, once you've created these constraints, you can use Oracle SQL Developer to find these constraints. Open your databases in the connections tab and find the table in the Tables folder. Double click your table and travel to the Constraints tab. You can tell here that the UNIQUE constraint still exists in this table, but it has a pretty disgusting name. It kind of wants to make me puke. Referencing that constraint in the future with that wacky name would be a burden. Engrave these three options in your head so that you can use any of them whenever you need and can read other peoples' code. Thank you for sticking with the series thus far. In the next video, we will be…doing something. See you then! :) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me on Patreon! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 17721 Caleb Curry
How to Drop Sequence From Database || Drop Sequence From Oracle || Sequence Dropping
 
01:46
This is latest video of Learn from game, And here we have described whole process of Dropping sequence from Oracle database If you like this video please like share comments and Subscribe Here this is our official fan page : https://www.facebook.com/learnfromgame/ Our official Youtube Channel : https://www.youtube.com/channel/UCuLS... Gyz you can mail us your request we will try our best for support you Thank you So Much be with us !
Views: 37 Learn From Game
How to get List of Enabled / Disabled Check Constraint in SQL Server Database-SQL Server P86
 
07:40
SQL Server / T-SQL Tutorial Scenario: You are working as SQL Server Developer and you are asked to provide list of all Check Constraint with status if enabled or disabled. Link to scripts used in SQL Server / TSQL Tutorial Video http://www.techbrothersit.com/2016/05/how-to-get-list-enabled-disabled-check.html Check out our website for Different SQL Server, MSBI tutorials and interview questions such as SQL Server Reporting Services(SSRS) Tutorial SQL Server Integration Services(SSIS) Tutorial SQL Server DBA Tutorial SQL Server / TSQL Tutorial ( Beginner to Advance) http://www.techbrothersit.com/
Views: 693 TechBrothersIT
DYNAMIC SQL WITH EXECUTE IMMEDIATE IN ORACLE PL/SQL WITH EXAMPLE
 
21:53
The audio and video now synced. Ever tried creating a table inside a PL SQL block, or a function or a procedure? If yes, then you would know that it would raise an error, as DDL statements are not allowed inside a PL/SQL Block. So the solution to such a case, where you want to generate tables, or sequences or want to execute any DDL statement on the fly, then use synamic sql. Dynamic SQL statment will allow you to create state statements on the fly and then you can execute them using the execute immediate statement. This video tutorial demonstrates on this topic of using synamic sql with execute immediate in a PL/SQL block.
Views: 5586 Kishan Mashru
How to Enable all Check Constraints in SQL Server Database - SQL Server / TSQL Tutorial Part 88
 
03:32
SQL Server / TSQL Tutorial Scenario: You are working as SQL Server developer or ETL developer, You disabled all the Check Constraints in SQL Server Database before loading data. You need to provide the script that should be able to generate the enable Check Constraint scripts for all the Check Constraints which are disabled in SQL Server Database. Link to scripts used in SQL Server / TSQL Tutorial Video http://www.techbrothersit.com/2016/05/how-to-enable-all-check-constraints-in.html Check out our website for Different SQL Server, MSBI tutorials and interview questions such as SQL Server Reporting Services(SSRS) Tutorial SQL Server Integration Services(SSIS) Tutorial SQL Server DBA Tutorial SQL Server / TSQL Tutorial ( Beginner to Advance) http://www.techbrothersit.com/
Views: 539 TechBrothersIT
How to Resolve Oracle SQL Parent Key Not Found (ORA-02291)
 
05:49
In this video, we’ll explain what the ORA-02291 “parent key not found” error is, see an example, and look at how to resolve it. This error usually happens when we try to insert data into a table. It looks like this: Error is: ORA-02291: integrity constraint (constraint_name) violated - parent key not found So what does this error mean? It means we’re trying to insert data into a child table, and there is no related record in the parent table. If a foreign key has been set up to enforce this relationship, there needs to be a parent to insert a child that refers to it. Watch the video to see an example of this error as well as how to resolve it. For more information on Oracle SQL, refer to the Database Star website here: https://www.databasestar.com/
Views: 4930 Database Star
SQL Server 27 - How to Create FOREIGN KEY Constraints
 
04:25
In the previous video we set up an entire table. The problem with this table is that the species column is just plain text. The problem with this is that there is a higher probability of incorrect data and if we have tons of animals in here there will be a lot of redundant information. The solution to this is to change this species to a foreign key to another table. Remember that when you create a foreign key it is a child to a parent. The thing you need to know is that the parent has to exist before the child so the child has something to reference. So let's create the parent table. CREATE TABLE Species( ID INT PRIMARY KEY IDENTITY, Species VARCHAR(50) NOT NULL UNIQUE, FriendlyName VARCHAR(50) NOT NULL //NOT UNIQUE because multiple rows could be same category (Ex: Bunny) ); Now, the friendly name will likely have redundant data, so maybe later we can add a table for animal categories or something, but let's not overwhelm ourselves quite yet. Maybe in a few videos. Now that we have created that table, we can recreate the table that references it. The first thing to know when creating a foreign key is that the data type must match. Because the ID column in the species table is of type INT, we should make our Species column in the Animals table also of type INT. Secondly, to make this a foreign key we add REFERENCES Species(ID) to the Species column. DROP TABLE IF EXISTS Animals; CREATE TABLE Animals( ID INT PRIMARY KEY IDENTITY, Name VARCHAR(50) NOT NULL, Species INT NOT NULL REFERENCES Species(ID), ContactEmail VARCHAR(50) NOT NULL UNIQUE ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 10738 Caleb Curry
SQL for Testers or Test Analysts
 
02:03:07
• SQL can execute queries against a database • SQL can retrieve data from a database • SQL can insert records in a database • SQL can update records in a database • SQL can delete records from a database • SQL can create new databases • SQL can create new tables in a database • SQL can create stored procedures in a database • SQL can create views in a database • SQL can set permissions on tables, procedures, and views SQL Keywords Keyword Description ADD Adds a column in an existing table ADD CONSTRAINT Adds a constraint after a table is already created ALTER Adds, deletes, or modifies columns in a table, or changes the data type of a column in a table ALTER COLUMN Changes the data type of a column in a table ALTER TABLE Adds, deletes, or modifies columns in a table ALL Returns true if all of the subquery values meet the condition AND Only includes rows where both conditions is true ANY Returns true if any of the subquery values meet the condition AS Renames a column or table with an alias ASC Sorts the result set in ascending order BACKUP DATABASE Creates a back up of an existing database BETWEEN Selects values within a given range CASE Creates different outputs based on conditions CHECK A constraint that limits the value that can be placed in a column COLUMN Changes the data type of a column or deletes a column in a table CONSTRAINT Adds or deletes a constraint CREATE Creates a database, index, view, table, or procedure CREATE DATABASE Creates a new SQL database CREATE INDEX Creates an index on a table (allows duplicate values) CREATE OR REPLACE VIEW Updates a view CREATE TABLE Creates a new table in the database CREATE PROCEDURE Creates a stored procedure CREATE UNIQUE INDEX Creates a unique index on a table (no duplicate values) CREATE VIEW Creates a view based on the result set of a SELECT statement DATABASE Creates or deletes an SQL database DEFAULT A constraint that provides a default value for a column DELETE Deletes rows from a table DESC Sorts the result set in descending order DISTINCT Selects only distinct (different) values DROP Deletes a column, constraint, database, index, table, or view DROP COLUMN Deletes a column in a table DROP CONSTRAINT Deletes a UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraint DROP DATABASE Deletes an existing SQL database DROP DEFAULT Deletes a DEFAULT constraint DROP INDEX Deletes an index in a table DROP TABLE Deletes an existing table in the database DROP VIEW Deletes a view EXEC Executes a stored procedure EXISTS Tests for the existence of any record in a subquery FOREIGN KEY A constraint that is a key used to link two tables together FROM Specifies which table to select or delete data from FULL OUTER JOIN Returns all rows when there is a match in either left table or right table GROUP BY Groups the result set (used with aggregate functions: COUNT, MAX, MIN, SUM, AVG) HAVING Used instead of WHERE with aggregate functions IN Allows you to specify multiple values in a WHERE clause INDEX Creates or deletes an index in a table INNER JOIN Returns rows that have matching values in both tables INSERT INTO Inserts new rows in a table INSERT INTO SELECT Copies data from one table into another table IS NULL Tests for empty values IS NOT NULL Tests for non-empty values JOIN Joins tables LEFT JOIN Returns all rows from the left table, and the matching rows from the right table LIKE Searches for a specified pattern in a column LIMIT Specifies the number of records to return in the result set NOT Only includes rows where a condition is not true NOT NULL A constraint that enforces a column to not accept NULL values OR Includes rows where either condition is true ORDER BY Sorts the result set in ascending or descending order OUTER JOIN Returns all rows when there is a match in either left table or right table PRIMARY KEY A constraint that uniquely identifies each record in a database table PROCEDURE A stored procedure RIGHT JOIN Returns all rows from the right table, and the matching rows from the left table ROWNUM Specifies the number of records to return in the result set SELECT Selects data from a database SELECT DISTINCT Selects only distinct (different) values SELECT INTO Copies data from one table into a new table SELECT TOP Specifies the number of records to return in the result set SET Specifies which columns and values that should be updated in a table TABLE Creates a table, or adds, deletes, or modifies columns in a table, or deletes a table or data inside a table TOP Specifies the number of records to return in the result set TRUNCATE TABLE Deletes the data inside a table, but not the table itself UPDATE Updates existing rows in a table VALUES Specifies the values of an INSERT INTO statement VIEW Creates, updates, or deletes a view WHERE Filters a result set to include only records that fulfill a specified condition
Views: 123 BlueSky Citadel
SQL Server 25 - Drop Table
 
03:44
In the previous video I created a table with the bare minimum information. If we want SQL Server to really understand how our database should work, we have to give it some extra information. The problem is though that if we try to run the CREATE TABLE command again the database will complain that the table already exists. This video will teach you how to DROP (delete) a table. DROP TABLE Animals Just remember that the syntax is almost identical to CREATE TABLE with the exception of having no parenthesis. That's because we don't have to specify any columns because we are getting rid of the whole thing. Be warned before doing this though because it will delete all of the data inside of the table if there is any. The second problem we will encounter is that if we try to get rid of the table and it has already been dropped. The problem here is that as we are practicing CREATE TABLE we don’t want to have to worry about figuring out if the table already exists before we try dropping it. We essentially want a way to say "If this table already exists, delete it." There is actually a very easy way to do this in SQL Server: DROP TABLE IF EXISTS Animals Now, if the table does it exist it will be dropped, if it doesn't then nothing will happen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 3390 Caleb Curry
MSSQL - Understanding Isolation Level By Example (Serializable)
 
08:46
Example SQL Statements below used in the video, you can Copy and Paste for Transaction Isolation Level of Serializable, Read Committed, Read Uncommitted, Repeatable Read --===================================== -- Windows/Session #1 --===================================== SELECT @@SPID IF EXISTS (SELECT 1 FROM sys.tables WHERE name = 'SampleTable') DROP TABLE SampleTable CREATE TABLE [SampleTable] ( [Id] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](100) NULL, [Value] [varchar](100) NULL, [DateChanged] [datetime] DEFAULT(GETDATE()) NULL, CONSTRAINT [PK_SampleTable] PRIMARY KEY CLUSTERED ([Id] ASC) ) INSERT INTO SampleTable(Name, Value) SELECT 'Name1', 'Value1' UNION ALL SELECT 'Name2', 'Value2' UNION ALL SELECT 'Name3', 'Value3' SELECT * FROM SampleTable BEGIN TRAN INSERT INTO SampleTable(Name, Value) VALUES('Name4', 'Value4') --UPDATE SampleTable SET Name = Name + Name --UPDATE SampleTable SET Name = Name + Name WHERE Name = 'Name1' UPDATE SampleTable SET Name = Name + Name WHERE ID = 2 DELETE FROM SampleTable WHERE ID = 4 WAITFOR DELAY '00:0:10' COMMIT TRAN --===================================== -- Windows/Session #2 --===================================== --------------------------------------------------- -- This window/session is default READ COMMITTED -- --------------------------------------------------- SELECT @@SPID BEGIN TRAN SELECT * FROM SampleTable WAITFOR DELAY '00:00:10' SELECT * FROM SampleTable WAITFOR DELAY '00:00:10' SELECT * FROM SampleTable ROLLBACK SELECT b.name, c.name, a.* FROM sys.dm_tran_locks a INNER JOIN sys.databases b ON a.resource_database_id = database_id INNER JOIN sys.objects c ON a.resource_associated_entity_id = object_id --===================================== -- Windows/Session #3 --===================================== ----------------------------------------------------- -- This window/session is REPEATABLE READ -- ----------------------------------------------------- SELECT @@SPID SET TRANSACTION ISOLATION LEVEL REPEATABLE READ BEGIN TRAN SELECT * FROM SampleTable WAITFOR DELAY '00:00:10' SELECT * FROM SampleTable WAITFOR DELAY '00:00:10' SELECT * FROM SampleTable COMMIT TRAN --===================================== -- Windows/Session #4 --===================================== ----------------------------------------------------- -- This window/session is SERIALIZABLE -- ----------------------------------------------------- SELECT @@SPID SET TRANSACTION ISOLATION LEVEL SERIALIZABLE BEGIN TRAN SELECT * FROM SampleTable WAITFOR DELAY '00:00:10' SELECT * FROM SampleTable WAITFOR DELAY '00:00:10' SELECT * FROM SampleTable COMMIT TRAN
Views: 14260 CodeCowboyOrg
Oracle Database11g tutorials 16: How to uninstall oracle 11g from windows 7 64 bit
 
08:49
How To Properly Uninstall oracle database 11g from windows 7 and 8 manually without formatting your Computer By Manish Sharma Rebellion Rider Blog Link http://bit.ly/uninstall-oracle-11g-from-win-7 Website: www.RebellionRider.com Manual Un-Installation of Oracle Database 11g. This video will show you proper process on uninstalling Oracle database 11g from windows 7 64 bit. How to uninstall oracle 11g on windows 7 / How to uninstall oracle 10g on windows 7 Read How to uninstall oracle 11g on windows http://www.rebellionrider.com/how-to-uninstall-oracle-database-11g-from-windows-7.html YouTube Video on How to create database http://bit.ly/create-database-using-DBCA Tool used in this tutorial is command prompt. This tutorial series is part of SQL expert exam certification training. if you are preparing for SQL certification you can use my tutorials. This SQL Tutorial is a part of free training. Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=j7eYO7 Contacts E-Mail [email protected] Twitter https://twitter.com/rebellionrider Instagram http://instagram.com/rebellionrider Facebook. https://www.facebook.com/imthebhardwaj Linkedin. http://in.linkedin.com/in/mannbhardwaj/ Thanks for linking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com
Views: 266706 Manish Sharma
Oracle Sql : Exists Clause
 
21:26
Topic : Exists Clause 19th Video of this Series Comments/Suggestions are welcome get in touch with us, by mailing [email protected] for Upcoming trainings. This is an Unedited Video from the Live sessions on Sql (RDBMS) I will be posting a complete series of these tutorials on this channel, If you would like to be notified every time i post something ; Please subscribe to this channel and press the bell icon.
Views: 69 CodeSmith 001
Java & MySQL - Check if a value already exists
 
12:03
Easy tutorial on how to check if a value already exists in the database.
Views: 31072 Mozoran
How to drop Foreign Key Constraints in SQL Server Database for all the tables -  SQL Server  Part 72
 
04:08
SQL Server / T-SQL Tutorial Scenario: You are working as SQL Server developer, you are asked to provide the scripts those can be used to drop Foreign Key Constraints on all the tables in a database if exists. Link to scripts used in SQL Server / TSQL Tutorial Video http://www.techbrothersit.com/2016/04/how-to-drop-foreign-key-constraints-in.html Check out our website for Different SQL Server, MSBI tutorials and interview questions such as SQL Server Reporting Services(SSRS) Tutorial SQL Server Integration Services(SSIS) Tutorial SQL Server DBA Tutorial SQL Server / TSQL Tutorial ( Beginner to Advance) http://www.techbrothersit.com/
Views: 2619 TechBrothersIT
How to create Unique Constraint on Column for already existing Table - Part 97
 
04:59
SQL Server / T-SQL Tutorial Scenario: You are working as SQL Server developer, you need to create Unique Constraint on already existing table called dbo.Customer on column SSN. Link to scripts used in SQL Server / TSQL Tutorial Video http://www.techbrothersit.com/2016/05/how-to-create-unique-constraint-on_6.html Check out our website for Different SQL Server, MSBI tutorials and interview questions such as SQL Server Reporting Services(SSRS) Tutorial SQL Server Integration Services(SSIS) Tutorial SQL Server DBA Tutorial SQL Server / TSQL Tutorial ( Beginner to Advance) http://www.techbrothersit.com/
Views: 1201 TechBrothersIT
17. RENAME Table and DROP Table in Oracle
 
03:06
In this video I will show you how to change the name of existing table and also how to drop the table. Dropping table can delete your all records exist in that database table. For Support =========== Email: [email protected] Contact Form: http://www.learninhindi.com/home/contact Our Social Media ================ Facebook: https://www.facebook.com/LearnInHindi Twitter: https://twitter.com/LearnInHindi For Training & Videos ===================== For more videos and articles visit: http://www.learninhindi.com Free Java Programming In Hindi Course ===================================== https://www.youtube.com/playlist?list=PLOZ3jentlCDAwwhMyoLISrxkXTADGp7PH Free Oracle PL/SQL Programming In Hindi Course ============================================== https://www.youtube.com/playlist?list=PLB5DA82419C2D99B6 Free C Programming In Hindi Course ================================== https://www.youtube.com/playlist?list=PLOZ3jentlCDAxKpBLMWogxSdy6BZcsAJq Trips & Tricks Channel ====================== https://www.youtube.com/channel/UCGmLfkuCo-3lHHJXRJ9HUMw Programming in Hindi Channel ============================ https://www.youtube.com/channel/UCudElIDgwNrybeAvXIy1HZQ
Views: 33962 ITORIAN
Difference between Delete and Truncate and Drop in Oracle Sql
 
14:04
This is a free tutorial on understanding difference between drop, delete and truncate statements. I have tried to cover most of the major difference between all these three statements and have also shown the same with simple and easy to understand examples. Hope it will be helpful to all. If you want more such videos of exciting and amazing 'difference between' concepts, check out the links below : union and union all : https://youtu.be/n9FqQOd8liY char and varchar2 : https://youtu.be/039qzwjWf4k replace and translate : https://youtu.be/HKYF77BGzOE procedure and function : https://youtu.be/q3LmOenL120 in and exists : https://youtu.be/REX4IjRYlFw rank and dense_rank : https://youtu.be/WGSX998hZ9M %type and %rowtype : https://youtu.be/MlLUFeZ_3eM
Views: 2023 Kishan Mashru
MSSQL - Understanding Isolation Level by Example (Read Uncommitted)
 
06:27
Example SQL Statements below used in the video, you can Copy and Paste for Transaction Isolation Level of Serializable, Read Committed, Read Uncommitted, Repeatable Read --===================================== -- Windows/Session #1 --===================================== IF EXISTS (SELECT 1 FROM sys.tables WHERE name = 'SampleTable') DROP TABLE SampleTable CREATE TABLE [SampleTable] ( [Id] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](100) NULL, [Value] [varchar](100) NULL, [DateChanged] [datetime] NULL, CONSTRAINT [PK_SampleTable] PRIMARY KEY CLUSTERED ([Id] ASC) ) INSERT INTO SampleTable(Name, Value) SELECT 'Name1', 'Value1' UNION ALL SELECT 'Name2', 'Value2' UNION ALL SELECT 'Name3', 'Value3' SELECT * FROM SampleTable BEGIN TRAN INSERT INTO SampleTable(Name, Value) VALUES('Name4', 'Value4') --UPDATE SampleTable SET Name = Name + Name --UPDATE SampleTable SET Name = Name + Name WHERE Name = 'Name1' UPDATE SampleTable SET Name = Name + Name WHERE ID = 1 WAITFOR DELAY '00:02:00' ROLLBACK --===================================== -- Windows/Session #2 --===================================== --------------------------------------------------- -- This window/session is default READ COMMITTED -- --------------------------------------------------- SELECT * FROM SampleTable SELECT * FROM SampleTable WITH (NOLOCK) SELECT * FROM SampleTable WHERE ID = 3 SELECT * FROM SampleTable WHERE Name = 'Name2' SELECT b.name, c.name, a.* FROM sys.dm_tran_locks a INNER JOIN sys.databases b ON a.resource_database_id = database_id INNER JOIN sys.objects c ON a.resource_associated_entity_id = object_id --===================================== -- Windows/Session #3 --===================================== ----------------------------------------------------- -- This window/session is default READ UNCOMMITTED -- ----------------------------------------------------- SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT * FROM SampleTable SELECT * FROM SampleTable SELECT * FROM SampleTable WHERE ID = 2 SELECT * FROM SampleTable WHERE Name = 'Name2' SELECT * FROM SampleTable WITH (NOLOCK)
Views: 9582 CodeCowboyOrg
ORACLE SQL AND PL/SQL INTERVIEW QUESTION : HOW TO CHANGE DATATYPE IN ORACLE SQL?
 
13:16
This video contains a demonstration on how to change the datatype of a column containing data, the video shows two approaches through which any user can easily change the datatype of a column in a table, the video also helps in solving the Oracle ORA-01440 error.
Views: 1199 Kishan Mashru
Oracle Order By clause تعليم أوراكل
 
11:35
by Mohamed El Desouki - محمد الدسوقى [email protected] Tel :00966 553450836 جامعة سلمان بن عبد العزيز - السعودية - الخرج How To Sort the Data using Order by Clause. كيفية ترتيب البيانات الناتجة من الأستفسار Text Book: Fundamentals of Database Systems, 5th Edition, by Elmasri/Navathe, published by Addison-W oracle create table statement oracle drop table statement oracle constraints database constraints primary key constraint foreign key constraint check constraint null not null constraint unique constraint insert into statement update statement delete statement select statement basic query where clause select where Like '%' Like '_' select where Like aggregate functions summary functions group by group by with aggregate functions
SQL Error ORA-00942 Table or View Does Not Exist in Oracle Database
 
05:03
How to use Tab View (Data Dictionary) of Oracle Database to solve the SQL Error ORA-00942 Table or View Does Not Exist error in Oracle Database ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog: http://bit.ly/ora-00942 Previous Tutorial ► ------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! ------------------------------------------------------------------------- ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ ___Facebook Official Page of Manish Sharma___ https://www.facebook.com/TheRebellionRider/ ___Facebook Official Page of RebellionRider.com___ https://www.facebook.com/RebellionRider.official/ You can also Email me at for E-mail address please check the About section Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Views: 8807 Manish Sharma
Oracle SQL Tutorial 17 - Designing Our Foreign Keys
 
07:47
We are going to continue working with the users table that we've started with, but we are going to add a few tables. Imagine a system where you can create projects. And users can be added to these projects. So this could be some kind of productivity app or a project management solution, think of JIRA. We are going to start with three tables. The first table is going to be a users table that contains all of the information about each user's account. We are then going to have a table that is called projects. Each project will have data about the project and a foreign key that is the creator of the project. This is a situation where the database design depends a lot on the business rules and requirements of the application. Is it appropriate to have only one creator, or can it have multiple creators? We are going to design it with only one creator per project to increase simplicity. The third table is going to be used to record what users are part of certain projects. This situation is a many to many relationship because we've decided that one user can be a part of multiple projects and an individual project can have multiple members working on it. Because this is a many to many relationship, it calls for an intermediary table, project_users. First, we will draw out the user table. We will have a user_id, username, first_name, and last_name. Now, this is our parent table, because it has no foreign keys. Now, this is our parent table, because it has no foreign keys. Other tables are going to be referencing this table, so they would be the children. The project table will have a project_id, title, description, and creator. The column that needs to be a foreign key is the creator. Let's move on to the next table and we'll get back to the foreign key of the project table. The other table was project_users. Knowing that this is an intermediary table, immediately we know that the first two columns are going to be foreign keys to the each of the other tables. Now, let's ask the important questions about the foreign keys. Let's first start with the project table's user column. The first thing we need to ask is what column does it need to reference? Remember, the only options are the columns that are UNIQUE. Our candidates are user_id and username. For now, let's go with username as it makes things easier to work with. Once we go into learning about joins, we will talk about joining things by ID. Different people do it different ways, with the majority using only ID columns for primary and foreign keys, but it's important to be familiar with different ways of doing things. The important thing to remember is that keys should never change, so if we should only reference the username if a user's username will never change. Should the foreign key be labeled UNIQUE? If yes, it means that a user can only create one project. I vote no. Should the foreign key be labeled NOT NULL? If not, it means that a project can exist without a creator. I vote no. Moving on to the next table, I think I'll have the columns reference the project's id and user's id, so we can get some experience referencing surrogate keys. We can apply to these foreign keys the same questions we asked about the other foreign key, and I would encourage you to do so and really think about why. But I can tell you that we are not going to want them to be NOT NULL, but not UNIQUE. Now that we have a pretty decent database design, we can proceed with creating our database. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HELP ME! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 11745 Caleb Curry
Oracle Group by - Having تعليم أوراكل
 
07:13
by Mohamed El Desouki - محمد الدسوقى [email protected] Tel :00966 553450836 جامعة سلمان بن عبد العزيز - السعودية - الخرج How to apply conditions on groups using Having. كيف تطبق شروط على الجروب Text Book: Fundamentals of Database Systems, 5th Edition, by Elmasri/Navathe, published by Addison-W oracle create table statement oracle drop table statement oracle constraints database constraints primary key constraint foreign key constraint check constraint null not null constraint unique constraint insert into statement update statement delete statement select statement basic query where clause select where Like '%' Like '_' select where Like aggregate functions summary functions group by group by with aggregate functions group by having having
SQL Tutorial - 13: Inserting Data Into a Table From Another Table
 
07:00
In this tutorial we'll learn to use the INSERT Query to copy data from one table into another.
Views: 270769 The Bad Tutorials
Oracle Final Revision - Part1 تعليم أوراكل
 
13:01
by Mohamed El Desouki - محمد الدسوقى [email protected] Tel :00966 553450836 جامعة سلمان بن عبد العزيز - السعودية - الخرج Final Revision on SQL . مراجعة شاملة على ماتم دراسته خلال السلسلة Text Book: Fundamentals of Database Systems, 5th Edition, by Elmasri/Navathe, published by Addison-W oracle create table statement oracle drop table statement oracle constraints database constraints primary key constraint foreign key constraint check constraint null not null constraint unique constraint insert into statement update statement delete statement select statement basic query where clause select where Like '%' Like '_' select where Like aggregate functions summary functions group by group by with aggregate functions
[Dropping an Index] 1 -  Dropping an index using the DROP INDEX command
 
02:52
Dropping an Index Given SQL Server tables named Customer_Details and XMLDocument in ABC_Bank database,you will view and practice how to drop an index using Transact-SQL commands 1 - Dropping an index using the DROP INDEX command 2 - Dropping an index created on a PRIMARY KEY Learn more and source code at : http://www.tutorialspoint.edu.vn/sql-server/163-maintaining-indexes/12611-workshop-maintaining-indexes.html
Views: 799 little fire
auto increment in sql oracle - ( Auto increment field )
 
03:07
auto increment in sql oracle ----------------------------------------------- CREATE table customers ( customer_id int not null, customer_name varchar(50), primary key (customer_id) ); create sequence customer_id minvalue 1 start with 1 cache 10; insert into customers values(customer_id.nextval,'maxwel'); -- to drop sequence drop sequence customer_id
Views: 9993 Data Disc
Difference between Case and Decode
 
10:14
This video tutorial explains on how case statement and decode function are different from each other. Though both of them are used in giving the if-then-else conditional functionality to sql statement, they differ much from each other, this video will walk through each of the difference with appropriate examples. If you want more such videos of exciting and amazing 'difference between' concepts, check out the links below : char and varchar2 : https://youtu.be/039qzwjWf4k replace and translate : https://youtu.be/HKYF77BGzOE procedure and function : https://youtu.be/q3LmOenL120 in and exists : https://youtu.be/REX4IjRYlFw rank and dense_rank : https://youtu.be/WGSX998hZ9M delete and truncate : https://youtu.be/u76wMm2byXo %type and %rowtype : https://youtu.be/MlLUFeZ_3eM
Views: 13895 Kishan Mashru
UNION AND UNION ALL SET OPERATOR IN ORACLE SQL WITH EXAMPLE
 
03:50
This video is to understand the difference between union and union all set operations. Along with that we have also showed some simple solution to the 'ORA-01789: query block has incorrect number of result columns' error message. If you want more such videos of exciting and amazing 'difference between' concepts, check out the links below : char and varchar2 : https://youtu.be/039qzwjWf4k replace and translate : https://youtu.be/HKYF77BGzOE procedure and function : https://youtu.be/q3LmOenL120 in and exists : https://youtu.be/REX4IjRYlFw rank and dense_rank : https://youtu.be/WGSX998hZ9M delete and truncate : https://youtu.be/u76wMm2byXo %type and %rowtype : https://youtu.be/MlLUFeZ_3eM
Views: 834 Kishan Mashru
Adding a check constraint - Part 6
 
11:39
In this video we will learn 1. How to add a check constraint in SQL Server 2. The purpose or use of check constraint Text version of the video http://csharp-video-tutorials.blogspot.co.uk/2012/08/check-constraint-in-sql-server-part-6.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-6-check-constraint.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 412661 kudvenkat
How to Alter Table in SQL Server by using Alter Statement - SQL Server / TSQL Tutorial Part 35
 
13:48
SQL Server / TSQL Tutorial Scenario: How to Alter Table in SQL Server by using Alter Statement Let's say that you are working as SQL Server developer in Mortgage Company. In TechBrotherIT database, there is Dbo.Customer Table with below definition. Create Table dbo.Customer (FirstName VARCHAR(50), LastName VARCHAR(50), Age TinyInt, PhoneNumber CHAR(9), DOB Date, Sex CHAR(1) ) You got the requirement in which you have to generate Alter statement for below changes Add Column Address to Customer Table Modify column FirstName data type from VARCHAR(50) to VARCHAR(60) Drop Column Age from Customer Table Link to Scripts used in the video http://www.techbrothersit.com/2016/02/how-to-alter-table-in-sql-server-by.html Check out our website for Different SQL Server, MSBI tutorials and interview questions such as SQL Server Reporting Services(SSRS) Tutorial SQL Server Integration Services(SSIS) Tutorial SQL Server DBA Tutorial SQL Server / TSQL Tutorial ( Beginner to Advance) http://www.techbrothersit.com/
Views: 2902 TechBrothersIT
DIFFERENCE BETWEEN CHAR AND VARCHAR2 DATATYPE IN ORACLE SQL
 
04:36
This video tutorial explains the difference between similar looking and used char datatype and varchar2 datatypes with an simple example. This video will answer the question such as how is the data internally stored differently for char and vacchar2 datatype. Also why is varchar2 much better option to be used than char data type is explained. If you want more such videos of exciting and amazing 'difference between' concepts, check out the links below : union and union all : https://youtu.be/n9FqQOd8liY replace and translate : https://youtu.be/HKYF77BGzOE procedure and function : https://youtu.be/q3LmOenL120 in and exists : https://youtu.be/REX4IjRYlFw rank and dense_rank : https://youtu.be/WGSX998hZ9M delete and truncate : https://youtu.be/u76wMm2byXo %type and %rowtype : https://youtu.be/MlLUFeZ_3eM
Views: 3602 Kishan Mashru
13.49 PRIMARY KEY, UNIQUE, FOREIGN KEY, REFERENCES, CONSTRAINT
 
06:33
Komplette Liste der Videos und zusätzliches Material auf http://datenbankenlernen.de Informatik, Uni Saarland: Bachelor: http://www.cs.uni-saarland.de/index.php?id=52&L=1&source=1349 Master: http://www.cs.uni-saarland.de/index.php?id=132&L=1&source=1349 Ph.D./Grad School: http://gradschool.cs.uni-saarland.de/&source=1349
SQL index
 
13:33
. Index 1) Why indexes? Indexes are used by queries to find data from tables quickly. Indexes are created on tables and views. Index on a table or a view, is very similar to an index that we find in a book. Clustered and Non-Clustered indexes Note that Id column is marked as primary key. Primary key, constraint create clustered indexes automatically if no clustered index already exists on the table and a nonclustered index is not specified when you create the PRIMARY KEY constraint. a clustered index dictates the physical storage order of the data in a table, a table can contain only one clustered index. A clustered index is analogous to a telephone directory Non Clustered Index: A nonclustered index is analogous to an index in a textbook. The data is stored in one place, the index in another place. Difference between Clustered and NonClustered Index: 1. Only one clustered index per table, where as you can have more than one non clustered index 2. Clustered index is faster than a non clustered index, because, the non-clustered index has to refer back to the table, if the selected column is not present in the index. 3. Clustered index determines the storage order of rows in the table, and hence doesn't require additional disk space, but where as a Non Clustered index is stored seperately from the table, additional storage space is required. Unique index is used to enforce uniqueness of key values in the index. Let's understand this with an example. Note: 1. By default, a PRIMARY KEY constraint, creates a unique clustered index, where as a UNIQUE constraint creates a unique nonclustered index. These defaults can be changed if you wish to. 2. A UNIQUE constraint or a UNIQUE index cannot be created on an existing table, if the table contains duplicate values in the key columns. Obviously, to solve this,remove the key columns from the index definition or delete or update the duplicate values. 3. By default, duplicate values are not allowed on key columns, when you have a unique index or constraint. For, example, if I try to insert 10 rows, out of which 5 rows contain duplicates, then all the 10 rows are rejected. However, if I want only the 5 duplicate rows to be rejected and accept the non-duplicate 5 rows, then I can use IGNORE_DUP_KEY option. An example of using IGNORE_DUP_KEY option is shown below.
Views: 19 R K
Oracle Database11g tutorials 14 : How to CREATE TABLE using sql developer and command prompt
 
08:36
Oracle Database11g tutorials 14 How to Create table using command prompt and Create table using sql developer Blog Link http://bit.ly/1TkY4Oe Time Line 0:25 Introduction of Tables in Database 1:03 What is Create Table (Introduction of create table) 1:30 Syntax of Create Table 2:08 How to create table using Command Prompt 4:55 How to create table using SQL Developer Links for Oracle Database tutorials 4: database connectivity using SQL developer and command prompt http://youtu.be/wSqoXRlXDUU You can have indepth knowledge about SQL create table here http://www.rebellionrider.com/sql-create-table.html Tool used in this tutorial is command prompt. This tutorial series is part of SQL expert exam certification training. if you are preparing for SQL certification you can use my tutorials. This SQL Tutorial is a part of free training. Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=j7eYO7 Contacts E-Mail [email protected] Twitter https://twitter.com/rebellionrider Instagram http://instagram.com/rebellionrider Facebook. https://www.facebook.com/imthebhardwaj Linkedin. http://in.linkedin.com/in/mannbhardwaj/ Thanks for linking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com Today in this oracle database tutorial we will see How to CREATE A TABLE. if we have to define a table in layman language then we can say that Tables are just a collection of Rows and Columns but In RDBMS tables are database objects which help in organizing data into ROWS and COLUMNS. We can also say that SQL tables are kind of data structure which are used by database for efficient storage of data. To create a table in our database we use SQL CREATE TABLE command. SQL CREATE TABLE is a type of DATA DEFINITION LANGUAGE also known as DDL. To Create a table in your schema you will require CREATE TABLE system privilege. In our future videos we will see what are system and object privileges and how to grant them to a user. Today for this video we will be using Sample schema HR which already has all the necessary privileges. Ohk Let's see the syntax. CREATE TABLE table name ( column name1 Data-Type(size), column name2 Data-Type(size), ..... ); CREATE TABLE is an oracle reserved word or say an Oracle key word whereas There are 3 different ways of creating a table in Oracle database. Creating a table using Command Line Interface (CLI) in Oracle database For demonstrating how to create table in oracle database using CLI, I'll be using Command prompt. Thats how we create table using command prompt. you can check your table structure by DESCRIBE command for that just write DESC and your table name. Like this Another way of creating a table is by using Graphic user interface (GUI) in Oracle database To demonstrate how to create table using GUI we will use SQL developer. Lets open our SQL developer I am connected to HR schema if you do not know how to create a connection to database using SQL developer please watch my oracle database tutorial 4 that explains database connectivity using SQL developer and command prompt. Link for this video is in the description below. So lets create a table. Creating a table using SQL developer is very easy we do not have to fire any query here. Let's start First of all right click on your connection in which you want to create a table and choose schema browser. This will open a separate schema browser pane or you can expend your connection by clicking this + sign and then right click on table and choose New Table. However I prefer working with schema browser so let's skip to schema browser pane here from the first drop-down list you can choose connection name and in the second drop down list you can choose what database objects you want to work with we want to create a table thus I'll choose table and then click this arrow here and choose option for new table Ok we have created a table wizard first of all give a unique name to your table and add some column as well. For this, click the green plus button. Now we already have a column so give it some name. Also choose a datatype from the list and specify any size you can check this not null column if in case you want to make this a mandatory column you can also specify default value and constraint If you want to make this column a primary key you can click here In my future video i'll show you what are these constraints and different ways of applying them on a column in a table. for this video we will concentrate on create table only so when you are done with all your columns click ok Thats your table You can double click on your table here and can see its structure. Thats it
Views: 189719 Manish Sharma
Using Alter command to add constraints to any column
 
02:28
This video describes how we can use alter command to add constraints to columns
Difference Between Delete and Truncate
 
03:41
Below is link for Useful Pl/SQL Books http://goo.gl/XMy0tt ---------------------------------------------------------- Difference Between Delete and Truncate in Detail On bigger picture they serve the same purpose but there are many Differences listed with examples Point Delete Truncate 1. Data Recovery Delete: Come under the DML Category, we need to commit or Rollback explicitly to make the changes permanent, so we can recover the data by Rollback command fully with in a session or up to a point if Save Points are used Fall In DDL Category (DDL Command issue the Auto commit implicitly) so no chances of Recovery even not using the Flashback table method. But Truncate operations are also logged , they didn’t generate redo SQL but they are logged , view for truncated data info V$LOGMNR_CONTENTS 2. Data Removal Delete Can remove all or selected data using the Where Clause predicates. Or we can say delete any subset of rows We can Truncate complete table or a partition or sub partition of a table. 3. Speed Delete is Slower because oracle maintain the redo logs for Read Consistency (so that every session connected can see a consistent data at a given point of time ) Delete is very time consuming activity especially when table have numerous indexes and Triggers associated with table Faster as no data logs are maintained no associated trigger firing. 4. DML Triggers Firing DML (Delete) triggers associated with table will fire. DML Trigger will not fire in case of truncate method. 5. Flashback Technology Data can be recovered even after commit operation using Flashback Table options Flashback_transaction_query table will give what to recover and up to which point. Data cannot be recovered in truncate method by Flashback table option. 6. Referential Integrity Constraint Behavior if we don’t have related data in child table then we can delete the data from the parent table or we have variants like On Delete Cascade & on Delete set Null. We can’t truncate a table with enable Referential Integrity Constraint, even there is no data in the child table, we have to disable or drop the constraint if we want to truncate the table. Exception: Truncate is possible if the FK is self-referential means primary key and foreign key are on the same table. 7. Space De allocation or Space Utilization No extent reset with delete when deleting rows from a table, extents are not de allocated, So if there were 50 extents in the table before the deletion, there will still be 50 after the deletion. Truncate: When a table is truncated it will free the space allocated except in case of reuse storage clause. This space can subsequently be used only by new data in the table or cluster resulting from insert or update operations .All extents are de allocated leaving only the extents specified when the table was originally created .Example So if the table was originally created with min extents 3, there will be 3 extents remaining when the tables is truncated. When you truncate a table, NEXT is automatically reset to the last extent deleted. 8. High Water Mark Delete will not reset the high water mark Truncate will reset the High Water mark which is very important for performance point of view as in case of full table scan and full index scan oracle will read all the block under high water mark this makes a lot of difference in terms of performance. 9. Cluster No as such restriction with delete. You cannot individually truncate a table that is part of a cluster. You must truncate the cluster, Delete all rows from the table, or drop and re-create the table. 10. Information Capturing Delete : we can capture the row information what we have deleted using Delete Method, f you are deleting multiple records then use composite data types (collections & records) Truncate Don’t have this feature of capturing the deleted records. 11. Function Based Index Impact DELETE You cannot delete rows from a table if a function-based index on the table has become invalid. You must first validate the function-based index. Truncate: No as such restriction 12. UNUSABLE Indexes Delete no as such feature. Truncate if table is not empty then truncate make all unusable indexes to useable. 13. Complex views You cannot delete data from a Complex view except through INSTEAD OF triggers. But we can delete data from simple Views and MV. We cannot truncate a view simple or complex but you can truncate MV with special Features like Preserve MV Logs and Purge MV Logs. 14. Privileges Delete You need to provide delete table privilege on object. Truncate you must have drop table privilege there is no truncate table privilege exists. 15. Domain Index No as such restriction You cannot truncate the object having domain index in invalid or In progress state
Views: 13986 Ram Gupta
72. SHOW COLUMNS in SQL (Hindi)
 
02:20
Please Subscribe Channel Like, Share and Comment Visit : www.geekyshows.com
Views: 6919 Geeky Shows
SQL SERVER - Lesson 6B - Create Database including Pointer Table
 
00:24
This video is without sound. The previous video is on how to create a Pointer Table, with sound; but my microphone is hard to hear. Below are the actual SQL commands: --- /************** THIS IS AN EXAMPLE OF CREATING A DATABASE IN SQL */ /**** FIRST, DROP ALL THE OLD FOREIGN-KEY CONSTRAINTS **** (SKIP THIS STEP IF THE CONSTRAINTS DO NOT EXIST ****/ ALTER TABLE ActorT DROP CONSTRAINT FK_ActorT_CountryT ALTER TABLE PointerT DROP CONSTRAINT FK_PointerT_ActorT ALTER TABLE PointerT DROP CONSTRAINT FK_PointerT_MovieT /**** SECOND, DROP ALL THE OLD TABLES **** (SKIP THIS STEP IF THE TABLES DON'T EXIST ****/ DROP TABLE CountryT DROP TABLE ActorT DROP TABLE PointerT DROP TABLE MovieT /**** CREATE THE MOVIE TABLE *****************/ CREATE TABLE MovieT( MovieID nchar(10) NOT NULL DEFAULT 'XX', MovieName nchar(50), MovieYear int ) ALTER TABLE MovieT ADD CONSTRAINT C_MovieT_PK PRIMARY KEY (MovieID) INSERT INTO MovieT (MovieID , MovieName , MovieYear ) VALUES ('ST' , 'Star Trek: The Motion Picture' , 1979 ), ('ST2' , 'Star Trek 2: The Wrath of Khan' , 1984 ), ('ST3' , 'Star Trek 3: The Search for Spock' , 1986 ), ('EWWBL' , 'Every Which Way But Loose' , 1975 ) SELECT * FROM MovieT /**** CREATE THE COUNTRY TABLE */ CREATE TABLE CountryT( CountryID nchar(2) NOT NULL DEFAULT 'XX', CountryDesc nchar(40) ) ALTER TABLE CountryT ADD CONSTRAINT C_CountryT_PK PRIMARY KEY (CountryID) INSERT INTO CountryT (CountryID, CountryDesc ) VALUES ('CA' , 'Canada' ), ('US' , 'USA' ), ('UK' , 'United Kingdom'), ('JP' , 'Japan' ) SELECT * FROM CountryT /**** CREATE THE ACTOR TABLE */ CREATE TABLE ActorT( ActorID int NOT NULL DEFAULT 0, FirstName nchar(20), LastName nchar(30), BirthCountry nchar(2) ) ALTER TABLE ActorT ADD CONSTRAINT C_ActorT_PK PRIMARY KEY (ActorID) INSERT INTO ActorT (ActorID , FirstName , LastName , BirthCountry ) VALUES (1 , 'Clint' , 'Eastwood' , 'US' ), (2 , 'William' , 'Shatner' , 'CA' ), (3 , 'Leonard' , 'Nimoy' , 'US' ), (4 , 'Toshiro' , 'Mifune' , 'JP' ) SELECT * FROM ActorT /**** DEFINE THE FOREIGN KEY LINKING ACTOR TABLE TO COUNTRY TABLE */ ALTER TABLE ActorT ADD CONSTRAINT FK_ActorT_CountryT FOREIGN KEY(BirthCountry)REFERENCES CountryT(CountryID) /**** CREATE THE POINTER TABLE FOR THE MANY-TO-MANY RELATIONSHIP BETWEEN THE ACTOR TABLE AND THE MOVIE TABLE */ CREATE TABLE PointerT( ActorID int NOT NULL DEFAULT 0, MovieID nchar(10) NOT NULL DEFAULT ' ' ) ALTER TABLE PointerT ADD CONSTRAINT C_PointerT_PK PRIMARY KEY (ActorID, MovieID); CREATE INDEX IX_PointerT_ActorID ON PointerT(ActorID) CREATE INDEX IX_PointerT_MovieID ON PointerT(MovieID) ALTER TABLE dbo.PointerT ADD CONSTRAINT FK_PointerT_ActorT FOREIGN KEY(ActorID) REFERENCES dbo.ActorT(ActorID) ALTER TABLE dbo.PointerT ADD CONSTRAINT FK_PointerT_MovieT FOREIGN KEY(MovieID) REFERENCES dbo.MovieT(MovieID) INSERT INTO dbo.PointerT (ActorID, MovieID) VALUES (1, 'EWWBL'), (2, 'ST' ), (2, 'ST2' ), (1, 'ST' ) SELECT * FROM PointerT SELECT * FROM PointerT INNER JOIN ActorT ON PointerT.ActorID = ActorT.ActorID INNER JOIN MovieT ON PointerT.MovieID = MovieT.MovieID UPDATE ActorT SET FirstName = 'Bill' WHERE ActorID = 2 and FirstName = 'William' SELECT * FROM ActorT INSERT INTO PointerT (ActorID, MovieID) VALUES (3, 'ST') SELECT * FROM PointerT DELETE FROM PointerT WHERE ActorID = 3 SELECT * FROM PointerT
Views: 1142 MS / Access
COALESCE IN ORACLE SQL
 
06:50
This video is the 4th video in the series of 'working with null', this video explains the working of the coalesce function in oracle sql. Also the video explains the use of coalesce function in oracle sql queries by perfect simple and easy to understand examples. COALESCE returns the first non-null expr in the expression list. You must specify at least two expressions. If all occurrences of expr evaluate to null, then the function returns null. Oracle Database uses short-circuit evaluation. The database evaluates each expr value and determines whether it is NULL, rather than evaluating all of the expr values before determining whether any of them is NULL. If all occurrences of expr are numeric datatype or any non numeric datatype that can be implicitly converted to a numeric datatype, then Oracle Database determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that datatype, and returns that datatype.
Views: 1133 Kishan Mashru
TSQL: "Cannot DROP TABLE Table because it is being referenced by view View"
 
06:08
Solving "Cannot DROP TABLE tblOurTable because it is being referenced by view_OurView."
Views: 85 SQLInSix Minutes