Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

149
Vistas
how to insert value into column of existing table

How to insert value into column of existing table?

I have a table which have 5 column

id | firstname | lastname | address | email                | course_id 
1  | Waleed    | Khan     | Karachi | something@gmail.com  |   null 

This table has 1000 rows but I added course_id column and want to insert value from another table named Courses.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You'll first need to specify what relationship the two tables are sharing. As mentioned in your question you want to create a column_id column in Students table. You'll create this column and then add foreign key constraint to the column. Add the constraint using ALTER TABLE Students ADD CONSTRAINT constraint_name FOREIGN KEY (column_id) REFERENCES Courses(id) ON DELETE CASCADE ON UPDATE CASCADE;

CASCADE on deleteion and updation will take care of record updation and deletion in Students table.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda