A database from the information

Hi I have the following concerning musical works database:

Set echo on

Drop table Musical_works cascade constraints;
Drop table Composer_det cascade constraints;
Drop table soloist_det cascade constraints;

Create table Musical_works)
Serial_no number (10) constraint pkmwork Primary key,.
Title Varchar2 (50).
Composer Varchar2 (20) constraint Comp_uniq unique.
Forced soloist Varchar2 (20) single solo_uniq.
Date of registration,
Short_desc Varchar2 (100),
Long_desc clob,
Playing_time number (3,2).
Full_recording blob,
Sample_clip blob
);

Create table Composer_det)
Composer Varchar2 (20) constraint pkcomposer Primary key,.
Date of born,
Death in date,
Biography clob,
Sample_clip Blob,
Foreign key REFERENCES Musical_works (composer) (composer)
);

Create table Soloist_det)
Soloist Varchar2 (20) constraint pksoloist Primary key,.
Date of born,
Death in date,
Biography clob,
Sample_clip Blob,
Foreign key REFERENCES Musical_works (soloist) (soloist)
);

I used the following procedures to add information to the database:

Set serveroutput on

Create or replace procedure add_works (in numbers, in work_title Serno varchar2,)
comp in varchar2, solo in varchar2, rec to date, shortdesc in varchar2, longdesc in clob.
length in number, fullrec in sampclip in blob, blob)
AS
Begin
DBMS_OUTPUT. Put_line ('Insert attempted");
Insert into Musical_works (Serial_no, title, composer, soloist, recorded, Short_desc, Long_desc, Playing_time, Full_recording, Sample_clip)
values (Serno, work_title, comp, solo, rec, shortdesc, longdesc, playtime, fullrec, sampclip);
DBMS_OUTPUT. Put_line ('Insert successful");
Exception
While other then DBMS_OUTPUT. PUT_LINE ('ERROR');
DBMS_OUTPUT. Put_line ('procedure failed");
End;
/

Create or replace procedure add_composer (model in varchar2, cbirth in date, death date,
cbiography in clob)
AS
Begin
DBMS_OUTPUT. Put_line ('Insert attempted");
Insert into Composer_det (composer, born, death, biography)
values (model, cbirth, dead, cbiography);
DBMS_OUTPUT. Put_line ('Insert successful");
Exception
While other then DBMS_OUTPUT. PUT_LINE ('ERROR');
DBMS_OUTPUT. Put_line ('procedure failed");
End;
/

Create or replace procedure add_soloist (solo in varchar2, sbirth date, sdeath date,
sbiography in clob)
AS
Begin
DBMS_OUTPUT. Put_line ('Insert attempted");
Insert into Soloist_det (soloist, born, death, biography)
values (solo, sbirth, sdeath, sbiography);
DBMS_OUTPUT. Put_line ('Insert successful");
Exception
While other then DBMS_OUTPUT. PUT_LINE ('ERROR');
DBMS_OUTPUT. Put_line ('procedure failed");
End;
/


From there I need deriveinformation on:

(1) ages of composers at this time back died if the person is no longer alive

(2) classification of shortest piece (< 5 minutes), medium (between 5 and 45 minutes) and long (> 45 minutes)

I'm using SQL * more

I'd appreciate any help

Hello

It will be easier if you can post some examples of data but check this query see if it works for you.

SELECT mw.composer,
       ROUND ( (SYSDATE - born) / 365, 2) AS age,
       DECODE (died, NULL, 'ALIVE AND KICKING', 'DECEASED') AS isalive,
       title,
       (CASE
           WHEN playing_time < 5 THEN 'short'
           WHEN playing_time BETWEEN 5 AND 45 THEN 'medium'
           WHEN playing_time > 45 THEN 'long'
        END)
          playing_desc
FROM musical_works mw, composer_det cd
WHERE mw.composer = cd.composer

Concerning

Tags: Database

Similar Questions

  • Someone been able to clone a database from the clouds 12 c

    Can I duplicate a database from an RMAN script defined by the user, as long as I understand the request to connect to the auxiliary database, but I was not able to get the "Clone Database" feature under the settings menu to work using an active duplicate.

    I get an error to user name password that is identical to what you would get if you did

    RMAN target / auxiliary sys / < password > catalog rman/rman@RMAN_tns as opposed to

    RMAN target sys / < password > auxiliary sys / < password > catalog rman/rman@RMAN_tns

    When you do a manual duplication...

    I have a SR with Oracle... but no matter who has managed to make this work?

    Thank you

    with the latest patch agent... everything works...

  • How export/import the database from the Tools menu in sql developer.

    Hello

    I need to export the database to a server and import it on another server db using the export function of database under the Tools menu in SQL developer. How to import it? This is for Oracle database 10g.

    Thank you

    Hello

    You can do it, but I do not recommend because sqldeveloper could eat all the memory of the system to analyze the script. Now the question is do you have also opted for storage option when you export, if yes make sure that similar tablespace exists or available in env b. Also if you want to use the generated sqldeveloper file you can run this file from sqlplus session

    sqlplus newuser/password
    sqlplus > @myexport.sql

    But my advice or suggestion or recommendation to be, you should consider using export/import or datapump but the decision is yours. Hope this helps

    Concerning

  • Direct printing from the information of the Web site

    Only, I'm new on this.

    How can I print a hard copy directly on my computer when I'm looking at a screen of document information Web site to go to my wireless HP printer, which is a HP Pro 8500 has Offject more?

    Regarding the Marg

    Hey @Marg360!

    Thanks for posting on the HP Forums!

    If you are looking at a document on a web page, then you should be able to go to the top of the page, click on file and click Print to print the page.  You can also select the text you want to print, right click and click on print.  This web site you are trying to print from and you get errors?

  • Is there a way to generate the command CREATE DATABASE from the DB?

    Version: 11.2.0.3

    Is there a way to generate the CREATE DATABASE command from an existing database?

    You can empty the CONTROLFILE to trace and you'll get a CREATE CONTROLFILE statement which you can turn into a CREATE DATABASE statement.

    ------------

    Sybrand Bakker

    Senior Oracle DBA.

  • How to re-create the database from the Complutense University of MADRID

    «I was able to change the connection DB from one to the other by changing the settings through the ' system properties '.» However, there are a few objects (tables) database created during installation of the Complutense University of MADRID. is there anyway that I can go to the new database and database get UCM objects re-created without re-installation of the UCM? It seems some sql scripts in the database directory, but I don't know how to operate, the order and setting are not clear for me.

    Thank you

    Hello

    One thing you can do to recreate the default tables and columns is to run the script all.sql on the DB that is specific for your db. If you want to just recreate a replica of the image then extract the ddl from your current database instructions and put it in a sql script that run directly on the another instance of db. In this case make sure you change instance specifc details in the extracted ddl script and replace with the instance details latest as the table space name, the user name will execute it and like wise.

    Another way would be to use archiver to create the batch file export for tables and then imported to the target instance. The way out for this is to go to Archiver Applet - create new Archive - Export - Tables and here and include any tables that are there in the content server.

    Hope this helps

    Thank you
    Srinath

  • How to change vCenter database from the default location to another drive?

    Hello

    I installed vc with sql 2005 express, now my vCenter server c:\ is almost full

    is it possible to move my vCenter database to a different drive

    concerning

    Maniac

    It's really interesting!

    Please try with a graphical interface. Right-click the DB-> tasks-> out-> select 'Drop connections.

    Then "Check" "Drop Connections" and click OK.

    Share the results...!

    See you soon,.

    VJ

  • Create the database from the backup file

    Hello

    Is it possible to create server Oracle 9i on another server just by using the production DB backup file?

    Thanks in advance

    user4426754 wrote:
    Thanks for your reply, yet one thing I want to know, if disaster, where I lost all database and now I only backup DB file, I can still create new database using this backupfile using duplicate?

    My friend, take the time and read the link that I gave to you, which you seem to have not checked so far. If you have a good backup, you're good to go.

    HTH
    Aman...

  • Trying to connect to a Web site, the following message displays error Impossible to connect to the database from the database. Could not connect to MySQL. It is only on a single Web site. What is c. What should I do?

    Could not connect to MySQL

    1. it sounds like a problem on server-side (which means there is nothing you can do about it probably)
    2. which site?

  • Information from two databases in the same query

    How can I get information from the "of" in addition to a db in a cfquery? for example, say in a db I have their name and in another PB I have their last name..., for example are my DB something like this: name FirstDB db and db I memberNumber, the first name and the name of the comic is SecondDB and in this PB I memberNumber, lastName.
    How can I run a query to collect the name of FirstDB and the name of SecondDB by the memberNumber?

    FirstDB:
    memberNumber 1
    First name Tom
    memberNumber 2
    firstName Patty

    SecondDB:
    memberNumber 1
    lastName Smith
    memberNumber 2
    lastName Dell

    then when I exit the query I could get Tom Smith and Patty Dell

    Thanks in advance for the help...


    SELECT count (*) 2 albums like County, name, city<---city is="" in="" the="" town="">
    Cities of people
    WHERE type = 1
    GROUP BY name

    There are several syntax errors in this example, but I assume that
    It is any example of code written in the message not copied no actual
    running the code. Knowing which becomes a SQL error help know
    where the problem may lie in the actual code.

    You may need to fully qualify your fields in the select clause for that
    the DBMS knows which database table, you want the field to come.

    SELECT page 2 of count (*) County, people.name, towns.city
    People, cities
    WHERE type = 1
    GROUP BY name, city

    OR with aliases:

    SELECT top 2 count (*) AS COUNT, p.name, t.city
    PEOPLE p, t of cities
    WHERE type = 1
    GROUP BY name, city

    You add all the new fields to your GROUP BY clause, correct? He
    It requires that all fields that are not used in aggregate function [such as
    Count()] be included in the GROUP BY clause.

  • Impossible to activate the broker configuration or display information from the database

    -J' I add databases primary and standby in a broker configuration:

    DGMGRL > see Configuring

    Configuration - DGConfig1

    Protection mode: MaxPerformance
    Databases:
    TEST_PRI - primary
    TEST_STD - physical of the standby database

    Fast-Start Failover: DISABLED

    The configuration status:
    SUCCESS
    ####################################
    - And the configuration of the

    DGMGRL > activate configuration;
    Permit.
    ################################
    - And see the new configuration

    DGMGRL > see the configuration;

    Configuration - DGConfig1

    Protection mode: MaxPerformance
    Databases:
    TEST_PRI - primary
    TEST_STD - physical of the standby database

    Fast-Start Failover: DISABLED

    The configuration status:
    SUCCESS

    ##################################
    -But, when I show the information of database

    DGMGRL > see the TEST_PRI database
    Object "test_pri" not found.

    #############################################
    -J' noticed 'ACTIVATE' notation is not see the place in the broker configuration, like this

    DGMGRL > see Configuring

    Configuration
    Name: DGConfig1
    Activated: YES < < < -.
    Protection mode: MaxPerformance
    Databases:
    pc00prmy - primary database
    pc00sby1 - physical of the standby database

    Fast-Start Failover: DISABLED

    Current situation for 'DGConfig1 ':
    SUCCESS

    ###########
    -Why my setup notes the mention: "enabled: Yes/No?
    - And in the configuration, it will list the databases (pri and stdby), but why I can not use 'show the TEST_PRI/TEST_STD database'

    :(

    Help, please
    So thank you
    Ch

    Hello;

    Show you:

    See the TEST_PRI database

    I think it should be:

    See the "TEST_PRI" database

    Other examples:

    DGMGRL > see THE DATABASE 'TEST_PRI', 'StatusReport. "
    DGMGRL > see THE DATABASE 'TEST_PRI', 'LogXptStatus;
    DGMGRL > see THE DATABASE 'TEST_PRI', 'InconsistentProperties ';
    DGMGRL > see THE DATABASE 'TEST_PRI', 'InconsistentLogXptProps ';

    Best regards

    mseberg

  • Get information directly from the database of the RMAN catalog

    All,

    Assuming that one is unable to connect to the target database, but can directly connect to the catalog database:

    HostName: rman.prod.hobank.net
    User name of the operating system: oracle
    Oracle SID: RMAN
    User RMAN: rman

    When you are connected to the RMAN database as user rman (as shown below),

    [oracle@rman] sqlplus rman/rman

    What views I need to ask for the following information:

    -Backups performed
    -Backup type (for each backup)
    -Calendar

    Thanks in advance.

    Baffy

    You can get all the information backup recovery catalog views. For example, V$ RC_BACKUP_SET, V$ RC_BACKUP_PIECE, V$ RC_BACKUP_FILES, etc. and the view contains the type of backup as
    V$ RC_BACKUP_FILES. BACKUP. But I don't understand your 'calendar' means.

  • Move the database on the DSO from one server to the other in AIX

    Hello

    We have a project to move a Database (11.2.0.2) in ASM (stand-alone IM 11.2.0.4) in AIX. I followed the steps, but it failed.

    1. on the source server, I stop the database and removed the data DISKGROUP. I also took the diskgroup backup metadata before going down it.

    2 storage team has removed the mapping of the discs and they remapped to the new server. However, the names of disks have changed
    Note: There is no oracleasm and the drive string used is/dev/rhdisk *. The number of disk changed in the new server. However, we have renamed these discs.

    3 installed GI in silent mode with the "software only" option and then set up AP using roothas.pl.

    4. install Oracle database on the same level of patch from the source.

    5 ASM set up using a small new disc using ASMCA in silent mode.

    6. after the configuration of ASM, I don't see the Diskgroup database, but I see the drives as CANDIDATE disks.

    7. now, I restored the metadata from backup I took in the first step.

    8 Diskgroup appears and mounted. However, there is no data. All the data disappeared.

    Please can anyone suggest what I missed? Support for Oracle is not clear in its instructions.

    It's test database, so we could afford to lose the data. We cannot follow duplicate RMAN that our Production database is very large, and all backups are in bands. We also long downtime. Therefore, the only option we have is to physically move the LUNS.

    In my opinion, ASM has not read the header information of disk that LUNS are mapped before ASM is configured and consider them as CANDIDATE disks. Please specify.

    Thank you

    Vikas

    ASM devices that belong to a disk group contain the header special ASM data, that ASM uses to identify the disks. The path of unity or the name of the device as such is irrelevant. ASM must know the chain drive in order to locate the devices. I do not know what has been mapped or put in correspondence, but if the disks appear as candidate ASM disks, then information should have been erased in the process.

    Why not simply create a full database backup using RMAN and then restore and recover the database on the new server? Provided that the new server has the same software and ASM starts, this should be easy.

  • Migrating the database from one server to another..., what are the impacts?

    Hello

    We currently have our Hyperion (workspace, planning, essbase) environment on a single windows server. The associated database (Oracle) with it is on another Windows Server.

    The platform will be shared, and for this, the database will be migrated on the server of hyperion. During the process, its name will be changed (but the users/schemas/password will remain)

    How to make the platform Hyperion welcomes such a change? The server name can be changed somehow in the configuration? Or do we reinstall us from scratch, the application?

    Thanks in advance for your help. Best regards.

    There is no need to re install, you will have to reconfigure all products with the new name of the host of the database by running the configuration utility, when you are prompted to use select existing table.
    Once Setup is complete for planning, you must change the information in the database for each application by modifying the database,

    Version number will be a real help here.

    See you soon... !!

  • Can save us the information contained in the forms of database?

    Hello

    I made a web form by Workbench and planed to use it to collect feedback from customers on the effects of specific campaigns. And I wanted to gather information in the database, like MySQL.

    On the recording of data, it seems that Adobe split into two parts, one for each database, and the other is by file system. I could find entities of files that are saved as .bin files in a specific folder in the side Server and hold in the database version-up information.

    And here's the point that I have to confirm that is it possible to record the information that customers filled in forms, such as name, phone number, birthday, etc., in the database? (Do not save the entire form by a spcific in file system file, but to save the information filled in the text boxes (fields) in the form of a database (MySQL) so that I could manage it with a few touches of spcific.)

    And then is it possible to encode it as an application by javascript program?

    Two very simple questions Yes or no.

    Best regards

    Shoku en

    Workspace really has nothing to do with the content of the space. The forms that you add in the Workbench are stored in the database and changes as you would on the form within the workspace would be also stored in the database.

    Now on the other end, the content space team has created a few points of integration between the processes and the content of space management. They give you the opportunity to start a process of approval of the content of the space. What it really does is what the document you want to review in a LiveCycle process, which creates a task in the workspace. Workspace is not yet aware that it comes from the content space. This close relationship is therefore only one way.

    If you want to integrate with the content of the space of your approval process (Workbench), you must use the service of space content, allowing you to add, delete (and more) documents in the content space.

    I hope this clarify some things.

    Jasmine

Maybe you are looking for

  • Music app

    The Quick Play tab on my stop watch work after watch OS 2.2, I have done all the usual restart, restore, Watch, iPhone and still nothing. no idea on how to turn it on.

  • Breaking the sequence of new execution

    I need to be able to monitor fans of controls and temperature on the object to be measured, while the I test UUT and interrupt the main sequence until the temperature returns to the bottom. I run a new run that runs the fan control in a different seq

  • Exchange of data between the main VI and sub - VI

    It is my first attempt to build a comprehensive program and hope you can help me. The idea is to load a set of data and to perform several calculations and operations on them, find themselves in the creation of a report file. What I want to do is to

  • Driver problems Clubhouse g6-2240sh

    Hello! I bought a g6-2240sh computer laptop yesterday Clubhouse! Windows 7 Ultimate has been installed on it. I realized the hp site that make the driver I remove but ran into problems! The problem is this: there are only supported above abandoned by

  • e-mail account was to send SPAM (from my list of contacts)

    My live.com e-mail account sent SPAM (from my list of contacts) which has a URL to a Canadian supplier Viagra. If I delete my contacts this Spamming stops. She will do even if my computer is turned off. Any ideas?